[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Collapse]WPF Controls
 [Expand]What's Installed
 [Expand].NET Core 3 Support
 [Expand]Common Concepts
 [Expand]MVVM Framework
 [Collapse]Controls and Libraries
  [Collapse]Data Grid
   [Expand]Getting Started
   [Expand]Implementation Details
   [Expand]Grid View Data Layout
   [Expand]Binding to Data
   [Expand]Master-Detail Data Representation
   [Expand]Data Editing and Validation
   [Expand]Filtering and Searching
   [Expand]Data Summaries
   [Expand]Paging and Scrolling
   [Expand]Focus, Navigation, Selection
   [Expand]Conditional Formatting
   [Expand]Appearance Customization
   [Expand]MVVM Enhancements
   [Expand]Printing and Exporting
   [Expand]End-User Interaction
   [Collapse]Performance Improvement
     Optimized Mode
     Server Side Data Processing
     Parallelizing Data-Intensive Operations
     Performing Multiple Data Updates
     Improving the Scrolling Experience
     Frequent Update Performance Enhancement
   [Expand]Design-Time Features
   [Expand]Visual Elements
   [Expand]End-User Capabilities
  [Expand]Ribbon, Bars and Menu
  [Expand]Charts Suite
  [Expand]Pivot Grid
  [Expand]Rich Text Editor
  [Expand]Tree List
  [Expand]Gauge Controls
  [Expand]Map Control
  [Expand]Layout Management
  [Expand]Windows Modern UI
  [Expand]Data Editors
  [Expand]Navigation Controls
  [Expand]Spell Checker
  [Expand]Property Grid
  [Expand]PDF Viewer
  [Expand]TreeMap Control
  [Expand]Gantt Control
  [Expand]Diagram Control
  [Expand]Windows and Utility Controls
   Dialogs, Notifications and Panels
  [Expand]Scheduler (legacy)
 [Expand]Scaffolding Wizard
  Redistribution and Deployment
  Get More Help
 [Expand]API Reference
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Report and Dashboard Server
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

Performing Multiple Data Updates

The GridControl refreshes its UI and internal state each time its data source collection is updated.

Depending on the size of your data source, the amount and frequency of updates, it may be useful to lock the GridControl and update it after all the data is updated.

Use the DataControlBase.BeginDataUpdate and DataControlBase.EndDataUpdate methods to prevent the control's internal data updates:

  1. Call the BeginDataUpdate method. The GridControl stops reacting on data updates.
  2. Perform data updates.
  3. Call the EndDataUpdate method. The GridControl updates its UI to reflect all the changes.

If a data source is modified from another thread (for example, using Parallel.ForEach), the grid cannot process these changes correctly, and an exception is thrown. To avoid possible issues, use one of the following approaches:

  • Use the System.Windows.Threading.Dispatcher.Invoke method to update the data source from the main thread
  • Enclose the changes within the BeginDataUpdate and EndDataUpdate method calls

Expanded Example

The code sample below demonstrates how to prevent GridControl from frequent updates during multiple data changes.

Refer to the How to display data which is being updated on another thread (MVVM) GitHub example for information on how to call the GridControl's BeginDataUpdate and EndDataUpdate methods in View Models.

Expanded See Also

Is this topic helpful?​​​​​​​