Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1285
Async expanding child
posted

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

Parents
No Data
Reply
  • 1285
    posted

    After posting, I tried to use the ReportProgress method of the backgroundworker class, to add items to collection. This worked.

Children