wpf-devexpress-dot-xpf-dot-grid-dot-datacontrolbase-d337bec0.md
Locks visual and internal data updates within the GridControl. Call the DataControlBase.EndDataUpdate() method to apply all pending changes and resume updates.
Namespace : DevExpress.Xpf.Grid
Assembly : DevExpress.Xpf.Grid.v25.2.Core.dll
NuGet Package : DevExpress.Wpf.Grid.Core
public void BeginDataUpdate()
Public Sub BeginDataUpdate
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 DataControlBase.EndDataUpdate() method to apply the pending changes.
A DataControlBase.EndDataUpdate() method call should follow every BeginDataUpdate() method call.
The TreeListView saves the current state of all nodes (selected or expanded) when you call the BeginDataUpdate() method and restores this state when you call DataControlBase.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 DataControlBase.EndDataUpdate().
The GridControl processes updates according to the data structure type in the TreeListView. Refer to the following topic for more information: Lock Updates.
The following code snippets (auto-collected from DevExpress Examples) contain references to the BeginDataUpdate() method.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.
wpf-treelist-load-nodes-dynamically/CS/DynamicNodeLoading/MainWindow.xaml.cs#L14
public void InitDrives() {
grid.BeginDataUpdate();
try {
wpf-data-grid-process-frequent-data-updates/CS/BeginEndDataUpdateExample/GridUpdateService.cs#L19
public void BeginDataUpdate() {
Grid.BeginDataUpdate();
}
wpf-data-grid-update-data-in-a-separate-thread/CS/GridUpdateService.cs#L18
if (GridControl != null) {
GridControl.BeginDataUpdate();
}
public void BeginUpdate() {
ActuaGridControl.BeginDataUpdate();
}
wpf-treelist-load-nodes-dynamically/VB/DynamicNodeLoading/MainWindow.xaml.vb#L19
Public Sub InitDrives()
Me.grid.BeginDataUpdate()
Try
wpf-data-grid-process-frequent-data-updates/VB/BeginEndDataUpdateExample/GridUpdateService.vb#L17
Public Sub BeginDataUpdate() Implements IGridUpdateService.BeginDataUpdate
Grid.BeginDataUpdate()
End Sub
wpf-data-grid-update-data-in-a-separate-thread/VB/GridUpdateService.vb#L28
If GridControl IsNot Nothing Then
GridControl.BeginDataUpdate()
End If
Public Sub BeginUpdate() Implements ICustomService.BeginUpdate
ActuaGridControl.BeginDataUpdate()
End Sub
See Also