Back to Devexpress

DataControlBase.EndDataUpdate() Method

wpf-devexpress-dot-xpf-dot-grid-dot-datacontrolbase-cb995126.md

latest5.7 KB
Original Source

DataControlBase.EndDataUpdate() Method

Unlocks visual and internal data updates in the GridControl and applies all pending changes after a DataControlBase.BeginDataUpdate call.

Namespace : DevExpress.Xpf.Grid

Assembly : DevExpress.Xpf.Grid.v25.2.Core.dll

NuGet Package : DevExpress.Wpf.Grid.Core

Declaration

csharp
public void EndDataUpdate()
vb
Public Sub

Remarks

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.BeginDataUpdate method to lock updates.

An EndDataUpdate() method call should follow every DataControlBase.BeginDataUpdate call.

The TreeListView saves the current state of all nodes (selected or expanded) when you call the DataControlBase.BeginDataUpdate method and restores this state when you call 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 EndDataUpdate().

The following code snippets (auto-collected from DevExpress Examples) contain references to the EndDataUpdate() 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#L25

csharp
catch { }
    grid.EndDataUpdate();
}

wpf-data-grid-process-frequent-data-updates/CS/BeginEndDataUpdateExample/GridUpdateService.cs#L23

csharp
public void EndDataUpdate() {
    Grid.EndDataUpdate();
}

wpf-data-grid-update-data-in-a-separate-thread/CS/GridUpdateService.cs#L26

csharp
if (GridControl != null) {
    GridControl.EndDataUpdate();
}

wpf-data-grid-call-begindataupdate-and-enddataupdate-at-view-model-level/CS/BeginEndDataUpdate/CustomService.cs#L31

csharp
public void EndUpdate() {
     ActuaGridControl.EndDataUpdate();
}

wpf-treelist-load-nodes-dynamically/VB/DynamicNodeLoading/MainWindow.xaml.vb#L30

vb
Me.grid.EndDataUpdate()
End Sub

wpf-data-grid-process-frequent-data-updates/VB/BeginEndDataUpdateExample/GridUpdateService.vb#L21

vb
Public Sub EndDataUpdate() Implements IGridUpdateService.EndDataUpdate
    Grid.EndDataUpdate()
End Sub

wpf-data-grid-update-data-in-a-separate-thread/VB/GridUpdateService.vb#L36

vb
If GridControl IsNot Nothing Then
    GridControl.EndDataUpdate()
End If

wpf-data-grid-call-begindataupdate-and-enddataupdate-at-view-model-level/VB/BeginEndDataUpdate/CustomService.vb#L35

vb
Public Sub EndUpdate() Implements ICustomService.EndUpdate
    ActuaGridControl.EndDataUpdate()
End Sub

See Also

BeginDataUpdate()

DataControlBase Class

DataControlBase Members

DevExpress.Xpf.Grid Namespace