GridViewExtension.GetBatchDeleteKeys<T>() Method

Returns a list of keys that correspond to grid records deleted on the client side in batch edit mode.

Namespace: DevExpress.Web.Mvc

Assembly: DevExpress.Web.Mvc5.v19.2.dll

Declaration

public static List<T> GetBatchDeleteKeys<T>()
Public Shared Function GetBatchDeleteKeys(Of T) As List(Of T)

Returns

Type Description
List<T>

A List<T> object that stores the list of keys.

Type Parameters

Name Description
T

Remarks

...
public ActionResult BatchUpdateAction() {
        List<string> keysToInsert = GridViewExtension.GetBatchInsertValues<string>(Data.Table.Columns[0].ColumnName);
        ...
        foreach (DataColumn column in Data.Table.Columns) {
            var newValues = GridViewExtension.GetBatchUpdateValues<string, string>(column.ColumnName);
            if (newValues != null) {
                Data.UpdateColumn(column.ColumnName, newValues);
            }
      ...
            var insertValues = GridViewExtension.GetBatchInsertValues<string>(column.ColumnName);
            if (insertValues != null) {
                Dictionary<string, string> dictionary = keysToInsert.ToDictionary(x => x, x => insertValues[keysToInsert.IndexOf(x)]);
                Data.UpdateColumn(column.ColumnName, dictionary);
            }
        }
    ...
        var deleteValues = GridViewExtension.GetBatchDeleteKeys<string>();
        if (deleteValues != null)
            Data.RemoveRows(deleteValues);
    ...
}
See Also