3 Answers, 1 is accepted
If you provide RadGridView with a QueryableCollectionView source, it will wrap its Items collection around this view and custom functionality such as the BindingOperations.EnableCollectionSynchronization method will be used. It will not, however, provide such functionality out of the box.
I've attached a small sample project demonstrating how to update the underlying collection from a BackgroundWorker. Please let me know if you find it helpful. If that is not the case, please provide more details regarding your exact requirements so that I can better assist you.
I look forward to your reply.
Regards,
Dilyan Traykov
Progress Telerik
Hey Dilyan,
Thanks for your answer, however this is not what I need. I am aware how to use dispatcher but this sample still add items on the main thread. I would like to be able to iterate and modify the collection from worker thread without the need to post it on the dispatcher. I would like to hear how I can use QueryableCollectionView with BindingOperations.EnableCollectionSynchronization. I am looking at Telerik source code and I can't find any use of BindingOperations.AccessCollection which leads me to the conclusion that you are not supporting synchronization using BindingOperations.EnableCollectionSynchronization. I might have older version of Telerik WPF UI. May be you added support for BindingOperations.EnableCollectionSynchronization recently? If you did, please tell me.
Thanks.
As suggested in my last reply, RadGridView does not enable such support out of the box. You can, however, use your own implementation by providing the control with an QueryableCollectionView as its source. I'm attaching an updated version of the previous project to demonstrate this.
You can have a look at the following articles which I believe you will find helpful:
- Observable Collection Cross-Thread Change Notification
- Cross-Thread Collection Synchronization Redux
Please let me know if any further questions or concerns arise.
Regards,
Dilyan Traykov
Progress Telerik