I have a class that has a property that is a collection. It may take a while to fill collection. When I bind to xamDataGrid and click the plus sign to expand the UI freezes.
I tried to fill collection using a background worker but I got an error:
XamDataGrid does not support changes (other than INotifyPropertyChanged.PropertyChanged or ListChangedType.ItemChanged) to its DataSource from a thread different from its Dispatcher thread.
Any ideas how I can accomplish this? This does not have to be a property, I was thinking of using an unbounded field. But don't know how to set it as an expandable child and set it after I fill it.
Any help will be much appreciated.
Thanks
Hello,
Thank you for your feedback. I am glad that you resolved your issue and I believe that other community members may benefit from this as well.
Thanks again.
After posting, I tried to use the ReportProgress method of the backgroundworker class, to add items to collection. This worked.