Skip to content

DevExpress-Examples/wpf-data-grid-refresh-on-timer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

62 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Data Grid for WPF - How to Refresh the Data Grid on a Timer

This example illustrates how to process GridControl updates on a timer. You can implement RefreshOnTimerCollection and wrap your data source in it. The collection blocks notifications about changes from the source and copies data in the specified time interval. Changes in RefreshOnTimerCollection trigger GridControl updates. You can use this technique if your data source contains less than 100K items and data changes frequently (for example, each millisecond).

The RefreshOnTimerCollection class exposes a constructor that accepts two parameters: the time interval and the data source collection.

// ...
data = new ObservableCollection<MarketData>(...);
Source = new RefreshOnTimerCollection(TimeSpan.FromSeconds(1), data); 
// ...

If the data source collection is too large, the GridControl may process updates incorrectly and visible UI lags can appear. In this case, you can increase the interval.

Files to Look At

Documentation

Does this example address your development requirements/objectives?

(you will be redirected to DevExpress.com to submit your response)

About

Update the Data Grid on a timer.

Topics

Resources

License

Stars

Watchers

Forks

Contributors 6