This example demonstrates three different techniques to handle frequent updates in the GridControl.
Use the ChunkList collection and optimized summaries to improve the speed of individual updates.
- MainWindow.xaml (VB: MainWindow.xaml)
- ChunkAndOptSummariesViewModel.cs (VB: ChunkAndOptSummariesViewModel.vb)
Wrap data update batches in BeginDataUpdate
and EndDataUpdate
methods calls. The BeginDataUpdate
method locks the GridControl
's UI and allows you to execute multiple updates. The EndDataUpdate
call unlocks updates and refreshes the GridControl
. In this example, a custom MVVM service calls these methods from the view model level (GridUpdateService).
- GridUpdateService.cs (VB: GridUpdateService.vb)
- BeginEndUpdateViewModel.cs (VB: BeginEndUpdateViewModel.vb)
- MainWindow.xaml (VB: MainWindow.xaml)
Set the AllowLiveDataShaping property to false
and use a collection that doesn't support notifications (for example, List<T>
) to ignore data shaping operations when data is changed. Call the GridControl.RefreshData method to display all changes in the control. In this example, a custom behavior refreshes the GridControl
each second (GridTimerRefreshBehavior).
- GridTimerRefreshBehavior.cs (VB: GridTimerRefreshBehavior.vb)
- RefreshDataViewModel.cs (VB: RefreshDataViewModel.vb)
- MainWindow.xaml (VB: MainWindow.xaml)
- WPF Data Grid - Call the BeginDataUpdate and EndDataUpdate Methods at the View Model Level
- Data Grid for WPF - Refresh the Data Grid on a Timer
(you will be redirected to DevExpress.com to submit your response)