不使用GridView自带的(删除,更新)需要使用girdview的 GridView_RowCommand 事件在grid里面的控件如button 定义 command 属性在gridview的 GridView_RowCommand 里面处理对应的command就好 protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == "Delete")
{
int id = Convert.ToInt32(e.CommandArgument);
// 删除记录的专门过程
DeleteRecordByID(id);
}
}