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
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 >>
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
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
[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