This is a migrated thread and some comments may be shown as answers.

Fast way to insert rows from Thread

3 Answers 93 Views
GridView
This is a migrated thread and some comments may be shown as answers.
LindenauAtSOG
Top achievements
Rank 2
LindenauAtSOG asked on 03 Feb 2020, 03:11 PM

Lets say we have a program that can search files for specific content and then display searchresults in a RadGridView.

The program uses multiple threads to search through those files.

Our problem here is, that when those threads get many search results the Dispatcher will be flooded with Add-Operations.
This causes massive ui-freezes.

My first approach to solve this issue was to "buffer" those searchresults and only invoke Add-Operations every second.
This is better but still freezing the ui.

So my question here is, is there a recommended way to setup a DataSource for RadGridView for this usecase?
Do I need to do stuff with CollectionViewSource?

3 Answers, 1 is accepted

Sort by
0
LindenauAtSOG
Top achievements
Rank 2
answered on 03 Feb 2020, 03:14 PM
Rightnow, we are using
ObservableCollection<T>
 with  
BindingOperations.EnableCollectionSynchronization.
0
Accepted
Vladimir Stoyanov
Telerik team
answered on 06 Feb 2020, 12:15 PM

Hello,

Speaking generally, if there are a lot of notifications for the UI to be updated it is possible that the WPF framework might not be able to handle them. With this in mind, I can suggest checking out the RadObservableCollection. It allows you to suspend the UI notifications for some time and resume them afterwards. 

That said, making sure that there is a larger amount of time between performing the add operations should also increase the responsiveness.

I hope you find this helpful. Don't hesitate to contact us again, if you have any other questions or concerns. 

Regards,
Vladimir Stoyanov
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
LindenauAtSOG
Top achievements
Rank 2
answered on 04 Jun 2020, 12:45 PM
For anyone digging this up, there is a solution now
https://docs.telerik.com/devtools/wpf/controls/radgridview/features/cross-thread-collection-changed-interval
Tags
GridView
Asked by
LindenauAtSOG
Top achievements
Rank 2
Answers by
LindenauAtSOG
Top achievements
Rank 2
Vladimir Stoyanov
Telerik team
Share this question
or