ASPxGridView 删除行后时间后,为什么一直loading
<dxwgv:GridViewCommandColumn VisibleIndex="10">
<DeleteButton Text="删除" Visible="True">
</DeleteButton>
</dxwgv:GridViewCommandColumn>
后端代码
protected void grid_RowDeleting(object sender, DevExpress.Web.Data.ASPxDataDeletingEventArgs e)
{
System.Collections.Generic.List<object> keyValues = this.grid.GetSelectedFieldValues("SerialID");
SalesOrderData ds = (SalesOrderData)Session["EditSalesOrder"];
DataRow[] dr = ds.SalesOrderDetailTable.Select("SerialID='" + e.Keys[0].ToString().Trim() + "'");
if (dr.Length > 0)
{
dr[0].Delete();
}
this.grid.CancelEdit();
e.Cancel = true;
this.grid.DataSource = ds;
this.grid.DataMember = ds.SalesOrderDetailTable.TableName;
this.grid.DataBind();
}
------解决方案--------------------------------------------------------
this.grid.DataSource = ds;
this.grid.DataMember = ds.SalesOrderDetailTable.TableName;
this.grid.DataBind();
e.Cancel = true; //放最后面
------解决方案--------------------------------------------------------
你的事件选得不对吧,删除事件后应该是 RowDeleted事件,而不是RowDeleting