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

Not all unique column items show up in filter popup.

4 Answers 256 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Chris Andrews
Top achievements
Rank 1
Chris Andrews asked on 17 Jun 2010, 10:38 PM
Hello All,

I am sure this was answered already, but I cannot seem to find it using any of my searches.

We have a RadGridView with quite a bit of data.  We are filtering on a column, but all of the unique values in that column do not show up in the filter list to select them.  The list seems to just stop and not display anything else after a certain point.

Is there a limitation on the number of items that appear in this list?  If so, what is the count and how can we turn off this list if the count is greater than the max.  (using a style preferably).

We are using Q1 2010 SP2 of the controls.

Thanks in advance,
Chris

4 Answers, 1 is accepted

Sort by
0
Accepted
Vlad
Telerik team
answered on 18 Jun 2010, 06:28 AM
Hello Chris,

 The grid will limit by default distinct value to top 1000. You can handle DistinctValuesLoading event and populate desired values similar to this demo.

Regards,
Vlad
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Chris Andrews
Top achievements
Rank 1
answered on 26 Aug 2010, 03:00 PM
Hello Again,

Sorry for the very long response, but I am just getting back to this as it was a low priority.  Is there any way to hide the distinct list entirely if there is going to be more than 1000 rows?  The demo app you sent me just fills the list with different results.

I'd simply like to show nothing if items will be > 1000.

Thanks Again,
Chris
0
Accepted
Rossen Hristov
Telerik team
answered on 26 Aug 2010, 03:26 PM
Hello Chris Andrews,

1. Attach to the DistinctValuesLoading event of the grid.
2. Call RadGridView's method GetDistinctValues by passing the column. There is an overload in which you can specify the maximum number of values to return. The overload without this parameter will return 1000 at most by default.
3. So after you call the GetDistinctValues method, if it returns 1000 or more, then simply assign null or Enumerable.Empty to the ItemsSource property of the event arguments. If it returns less than 1000 then assign the result to the ItemsSource property of the event arguments.

This should do it.

Kind regards,
Ross
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Chris Andrews
Top achievements
Rank 1
answered on 26 Aug 2010, 07:39 PM
Thanks Ross,

This gave us the bahavior we were looking for.
Tags
GridView
Asked by
Chris Andrews
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Chris Andrews
Top achievements
Rank 1
Rossen Hristov
Telerik team
Share this question
or