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

Max number of items in filter list

7 Answers 333 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Eli
Top achievements
Rank 1
Eli asked on 20 Dec 2011, 04:03 PM
I am using the 2011.2 version of Telerik.
We are using a rad grid view populated from a list of items about 5k or so long. When we hit the filter button the filter menu pops up, but it only has about half of the items available. Specifically, it sorts by string name (removing redundancies), only items up to those starting with the letter "M" are shown, where as I know that there are items all the way to "Z".

My question is this, is there a maximum number of items displayed in the filter's list? And if so, can we set the value higher?

Thanks,

Eli

7 Answers, 1 is accepted

Sort by
0
Rossen Hristov
Telerik team
answered on 21 Dec 2011, 10:36 AM
Hello Eli,

By default we display only the first 1000 distinct values. We believe that humongous lists of distinct values are nearly to useless for an end user who will prefer to do his filter with the lower part of the UI.

Anyway, we have exposed a public method on RadGridView that lets you override the default behavior. Here is how to set the amount of distinct values to unlimited:

this.grid.DistinctValuesLoading += (s, e) =>
{
    e.ItemsSource = this.grid.GetDistinctValues(e.Column, true, null);
};

The third parameter is a nullable int that allows you to specify the maximum amount of distinct values. If you leave this null it means get all distinct values no matter how many are they.

I hope this helps.

Regards,
Ross
the Telerik team

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

0
Eli
Top achievements
Rank 1
answered on 22 Dec 2011, 07:11 PM
Thank you, that solved the problem.
0
Wakas
Top achievements
Rank 1
answered on 21 Aug 2018, 04:50 PM
Is It possible to do this in xaml and not in code behind?
0
Stefan
Telerik team
answered on 23 Aug 2018, 12:19 PM
Hi Wakas,

Setting the number of distinct values in the filtering control of RadGridView can only be achieved by programmatically hooking up to the DistinctValuesLoading and setting the ItemsSource of the event arguments. Can you please clarify the obstacle to using such an approach?

Regards,
Stefan
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
Wakas
Top achievements
Rank 1
answered on 23 Aug 2018, 12:27 PM
No Obstacles, was just wondering.
0
Stefan
Telerik team
answered on 23 Aug 2018, 12:38 PM
Hi Wakas,

Thanks for the clarification.

I am afraid that I cannot provide an alternative to using the built-in event. In case you do not want to subscribe to it in code-behind, you can use the EventToCommandBehavior mechanism.

Let me know in case I can be of further assistance.

Regards,
Stefan
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
Gert
Top achievements
Rank 1
answered on 03 Jul 2020, 11:17 AM

[quote]

By default we display only the first 1000 distinct values. We believe that humongous lists of distinct values are nearly to useless for an end user who will prefer to do his filter with the lower part of the UI.

[/quote]

Our company is handling at least 5000 carrier in one country therefore it is not useless for us, filtering is working by default only for 25%!

Just for info by default the limit of distinct values in version 2020.1.115.45 is 1331 items/strings.

Many thans for the provided solution. No performance impact noticed.

 

BR Gert

 

 

Tags
GridView
Asked by
Eli
Top achievements
Rank 1
Answers by
Rossen Hristov
Telerik team
Eli
Top achievements
Rank 1
Wakas
Top achievements
Rank 1
Stefan
Telerik team
Gert
Top achievements
Rank 1
Share this question
or