<asp:GridView ID="GridView1" runat="server" AllowPaging="true" AllowSorting="true" AutoGenerateColumns="false">
 <Columns><asp:EditCommandColumn ButtonType="LinkBotton" UpdateText="更新" HeaderText="编辑" CancelText="取消" EditText="编辑"/>
<asp:ButtonColumn Text="删除" HeaderText="删除" CommandName="Delete"/>
</Column>
</asp:GridView>
在VS2008可以这样实现。但是在VS2010就只有<asp:BoundField><asp:ButtonField><asp:CheckBoxField><asp:CommandField><asp:DynamicField><asp:HyperLinkField><asp:ImageField><asp:TemplateField>
没有<asp:EditCommandColumn>  <asp:ButtonColumn>试了很久都不能实现。跪求熟悉VS2010的高人指点

解决方案 »

  1.   

    HyperLinkField
    ImageField
    就用这些,就很好
      

  2.   

    用ListView 更好用,增删改都有,自己也可以很方便设置
      

  3.   

    “试了很久”?干嘛写一大堆代码去试呢?在你的页面的Design窗口,选择整个GridView,然后用鼠标点击右上角的“>”符号,选择“Add new column->CommandField->Button->Edit/Update“或者“Edit Columns->CommandField->Add->Button”。简单的东西还要写代码,就不是一个好的设计人员,只是会点编程就用蛮力乱写代码。