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

How to override Select all filtering with customer event

3 Answers 139 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Pradeep
Top achievements
Rank 1
Pradeep asked on 25 Oct 2019, 10:03 PM

Hi,

I want to override the select all filtering in radgridview to avoid stack over flow exception as mentioned below 

https://docs.telerik.com/devtools/wpf/controls/radgridview/filtering/faq/stackoverflow-exception

https://docs.telerik.com/devtools/wpf/controls/radgridview/filtering/how-to/howto-display-all-distinct-values

 

Is there a way I can create custom list and change the item source? 

3 Answers, 1 is accepted

Sort by
0
Vladimir Stoyanov
Telerik team
answered on 30 Oct 2019, 12:52 PM

Hello Pradeep,

The way to avoid the exception described in this thread: StackOverflowException on selecting all distinct values is to use the approach demonstrated in Example 2 of the Display All Distinct Values article of handling the DistinctValuesLoading event of the RadGridView and setting the ItemsSource of the event arguments to a smaller number of items. Note, that the distinct values that you assign to the ItemsSource property of the event arguments should always be of the same type as the data displayed in the column. 

I hope you find this helpful.

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
Pradeep
Top achievements
Rank 1
answered on 30 Oct 2019, 02:11 PM

We want to consider all values for filtering. And not just show first 1k or 100 items. I got around the problem by using following properties: 

 

OptimizeDistinctFilterQuery: Set to true for columns that have huge distinct values.

IsFilteringDeferred: Set to true for columns that have huge distinct values.

 

Using these two properties I am able to avoid that error. Though the actual filtering itself takes long time now. But this is without the exception. 

 

In case there is another way or if this is fixed in future versions do let me know. We are currently using 2019.2.510.45 Telerik UI for WPF

0
Vladimir Stoyanov
Telerik team
answered on 04 Nov 2019, 12:40 PM

Hello Pradeep,

Thank you for the update. 

Using OptimizeDistinctFilterQuery property along with the IsFilteringDeferred property is a viable way to improve the scenario with a large number of distinct values. 

That said, there isn't another way to avoid the stackoverflow exception described in the article referenced in my previous reply, since it is thrown by the .NET Framework.

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.
Tags
GridView
Asked by
Pradeep
Top achievements
Rank 1
Answers by
Vladimir Stoyanov
Telerik team
Pradeep
Top achievements
Rank 1
Share this question
or