Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

Binding DataGrid to ObservableCollection (UI real time updates)

$
0
0

I am trying to create a very simple DataGrid bound to an Observable collection that will update the UI efficiently (my definition of efficient) and quickly (sub second updates).  My example has a largevolume of continuious data coming in.  In my test, I simply coded a for loop (1,000 - 10,000 times) that update exsiting rows/columns and inserts new rows (in the ObservableCollection)

I have made several attempts that included techniques noted below:

. Defining my presentation class referencing the interface => INotifyPropertyChanged

. Updating my observable collection with another thread (using BackGroundWorker)

  -  Inserting thread.sleep (in the for loop) to possibly give the UI an opportunity to refresh

I want to control when the UI is updated.  In other words, if a line is update 100 time in a second, I may chose to present the UI  on the "seconds" boundry (after the entire row [all columns] have been updated for that second)

Most of the examples that I find on the internet certainly update the datagrid (but only after my tight for - loop completes)

To make this even more frustrating, I got this to work with DataTables as the underlying bound respository.

I someone knows of an exsiting example, I would appreciate your comment.

Thanks in advance.

Regards....


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>