Skip to main content

ASPxTreeList.BatchUpdate Event

Occurs after an end-user clicks the Update button in batch edit mode and allows you to provide a custom data updating mechanism.

Namespace: DevExpress.Web.ASPxTreeList

Assembly: DevExpress.Web.ASPxTreeList.v23.2.dll

NuGet Package: DevExpress.Web

Declaration

public event ASPxTreeListBatchUpdateEventHandler BatchUpdate

Event Data

The BatchUpdate event's data class is ASPxTreeListBatchUpdateEventArgs. The following properties provide information specific to this event:

Property Description
DeleteValues Returns a list of deleted values. Inherited from ASPxDataBatchUpdateEventArgs.
Handled Specifies whether the ASPxGridBase.BatchUpdate event is handled. Inherited from ASPxDataBatchUpdateEventArgs.
InsertNodes Returns a list of inserted nodes.
InsertValues Returns a list of inserted values. Inherited from ASPxDataBatchUpdateEventArgs.
UpdateValues Returns a list of updated values. Inherited from ASPxDataBatchUpdateEventArgs.

Remarks

The batch edit mode allows modifying a batch of tree list data on the client side and sending it to the server in one request on clicking the Update button. You can use the BatchUpdate event to provide a custom data update mechanism.

Set the ASPxDataBatchUpdateEventArgs.Handled event argument property to true to indicate that the BatchUpdate event is handled, and therefore no default processing is required.

Refer to the Batch Edit Mode topic for more information.

The following example illustrates how to use the BatchUpdate event.

protected void treeList_BatchUpdate(object sender, ASPxTreeListBatchUpdateEventArgs e)
{
    foreach (var args in e.InsertNodes)
        InsertNewItem(args.NewValues);
    foreach (var args in e.UpdateValues)
        UpdateItem(args.Keys, args.NewValues);
    foreach (var args in e.DeleteValues)
        DeleteItem(args.Keys, args.Values);

    e.Handled = true;
}
See Also