我正在使用 GridView(以编程方式),但更新方法有问题。我单击编辑链接按钮,然后进行我想要的更改,但是当我单击更新链接按钮时,它返回到编辑方法,而不是调用更新方法。
知道为什么吗?
这是代码:
datagrid.AutoGenerateEditButton = true;
datagrid.RowUpdating += new GridViewUpdateEventHandler(datagrid_RowUpdating);
datagrid.RowEditing += new GridViewEditEventHandler(datagrid_RowEditing);
protected void datagrid_RowEditing(object sender, GridViewEditEventArgs e)
{
datagrid.EditIndex = e.NewEditIndex;
datagrid.DataBind();
}
private void datagrid_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
}