Skip to main content
All docs
V23.2

TreeListView.BeginDataUpdate(Boolean) Method

Locks data updates in the GridControl and allows you to specify when the control should update TreeListView nodes.

Namespace: DevExpress.Xpf.Grid

Assembly: DevExpress.Xpf.Grid.v23.2.dll

NuGet Package: DevExpress.Wpf.Grid.Core

Declaration

public void BeginDataUpdate(
    bool recreateNodesOnEndDataUpdateOnly
)

Parameters

Name Type Description
recreateNodesOnEndDataUpdateOnly Boolean

true to recreate nodes after a EndDataUpdate() call; false to update node hierarchy after each change in the data source.

Remarks

If you use the TreeListView, the GridControl processes updates according to the data structure type. Refer to the following topic for more information: Lock Updates. The BeginDataUpdate(Boolean) method works like DataControlBase.BeginDataUpdate() and accepts the recreateNodesOnEndDataUpdateOnly parameter. This parameter specifies when the control updates TreeListView nodes.

If you lock the GridControl, a user cannot change data within the control. You can accumulate changes and update data in one action. As a result, you can improve the performance of the GridControl during data shaping operations. Call the TreeListView.EndDataUpdate() method to apply the pending changes.

A TreeListView.EndDataUpdate() method call should follow every BeginDataUpdate(Boolean) method call.

The TreeListView saves the current state of all nodes (selected or expanded) when you call the BeginDataUpdate(Boolean) method and restores this state when you call TreeListView.EndDataUpdate(). If properties bound to the state are changed during data updates (see IsCheckBoxEnabledBinding and ExpandStateBinding), you can save the changed state. To do that, call the TreeListView.SaveNodesState method before TreeListView.EndDataUpdate().

See Also