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

Filtering RadGridView without freezing the UI

5 Answers 229 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Xoma
Top achievements
Rank 1
Xoma asked on 11 Oct 2011, 05:24 PM
Hi, I am trying to filter RadGridView in the background thread, to keep the UI active while user is typing his/her search string. All I am doing curretly is using custom predicate for all columns. With too many rows > 1K the UI get sluggish.


A

5 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 12 Oct 2011, 07:10 AM
Hello,

Can you verify if the problem is RadGridView specific? What's the situation with standard DataGrid?

Greetings,
Vlad
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Xoma
Top achievements
Rank 1
answered on 12 Oct 2011, 02:34 PM
Vlad, I am not suggesting that there is a problem with RadGridView, I am simply asking how can I implement filtering on background thread up to the point where I have filtered results and need to start hiding not filtered row, which will happen on UI thread.

A
0
Vlad
Telerik team
answered on 17 Oct 2011, 07:14 AM
Hi,

 Can you post more info about your setup? 

Greetings,
Vlad
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Xoma
Top achievements
Rank 1
answered on 17 Oct 2011, 03:03 PM
It's a touch screen medical app. The grid is stretched on the selection screen and contains pending/completed med. tests. We've removed the default filtering from the grid (the drop down UIControl with funnel icon on each columnHeader) and added "Search" On-Screen keyboard where our users can type text they are trying to search for. The grid filters on all columns where the cell's text contains a search string, every time the search string changes (no explicity "search" invoker). We have a ViewModel bound to this view and are using Telerik's QuerybleCollectionView as an itemsSource for the grid. The "performance" issue I was describing is when the grid gets populated with more than 2K items, at which point, each key press temporarily "freezes" the UI thread as it trying to filter, therefore taking a second or so for the OnScreen Search keyboard to show the current "search" text or to be more precise the last key(s) typed in/removed. To combat this situation I wanted to start a TPL Task/background thread where we would search the grid collection, and once the results are known I would update/dispatch all the cells that match the search string by either hiding/showing the rows.

A
0
Nedyalko Nikolov
Telerik team
answered on 20 Oct 2011, 12:32 PM
Hello Xoma,

Indeed RadGridView will refresh its contents on every key (as far as every key changes FilterDescriptors collection). I think that the best approach is to delay filtering until the search string is still changing.
You can take a look at this online example (the example is for Silverlight, but the same approach could be achieved in WPF also).

Greetings,
Nedyalko Nikolov
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
GridView
Asked by
Xoma
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Xoma
Top achievements
Rank 1
Nedyalko Nikolov
Telerik team
Share this question
or