</asp:BoundColumn>
<asp:HyperLinkColumn Text="传送数据" DataNavigateUrlField="id" DataNavigateUrlFormatString="showdetail.aspx?id={0}" HeaderText="Edit" NavigateUrl="showdetail.aspx">
cs 中用Request("")接收就可以

解决方案 »

  1.   

    在<asp:ButtonColumn ItemStyle-Width="100px" Text="删除" CommandName="Delete" />
    加上
    CommandArgument='<%# DataBinder.Eval(Container.DataItem, "id") %>' 然后在MyDataGrid_Delete中
    用e.CommandArgument获取id值
      

  2.   

    建一个模板列:
    <asp:TemplateColumn Visible="False" HeaderText="号">
      <ItemTemplate>
    <asp:Label ID="xh" Runat ="server" text='<%#container.dataitem("id")%>'>
    </asp:Label>
      </ItemTemplate>
    </asp:TemplateColumn>sql语句:String = "delete from 表名 where id=" & CType(e.Item.Cells(0).FindControl("xh"), Label).Text & ""然后执行这条语句
      

  3.   

    将数据列的id作为datagrid的隐藏列。
    要删除的时候,读要删除行取的列的值就行了。