I currently have a WPF DataGrid binded to a DataSet via the DataGrid’s ItemsSource property in my program. With my current setup, I am having load-time issues that cause the GUI to lock up. Is it possible to multithread the loading of the DataGrid so that it will populate the rows as they are loaded instead of loading all the rows and then populating the DataGrid as it is currently?
I’m very new to the concept of multithreading, so any help will be appreciated!
The problem is to access the UI controls you need be be on the UI thread, so for data binding it’s difficult to simply do the work in a separate thread which is otherwise relatively easy. In fact this case requires a bit of trickery.
There’s a really good example here which shows how to accomplish this using data virtualization:
http://www.codeproject.com/KB/WPF/WpfDataVirtualization.aspx