您可以使用通用函数来处理网格的 CRUD 或每次直接调用 DBRow(InsertDBRow, UpdateDBRow & DeleteDBRow) 函数之一。您可以在下面找到示例:
protected void UltraWebGrid_UpdateRow(object sender, Infragistics.WebUI.UltraWebGrid.RowEventArgs e)
{
CRUDHelper(e, UltraWebGrid);
}
private void CRUDHelper(Infragistics.WebUI.UltraWebGrid.RowEventArgs e, UltraWebGrid pUltraWebGrid)
{
switch (e.Row.DataChanged)
{
case Infragistics.WebUI.UltraWebGrid.DataChanged.Added:
pUltraWebGrid.InsertDBRow(e.Row);
break;
case Infragistics.WebUI.UltraWebGrid.DataChanged.Modified:
pUltraWebGrid.UpdateDBRow(e.Row);
break;
case Infragistics.WebUI.UltraWebGrid.DataChanged.Deleted:
pUltraWebGrid.DeleteDBRow(e.Row);
break;
}
}