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

GetDistinctValues for a custom filter

1 Answer 111 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Patrick
Top achievements
Rank 2
Iron
Iron
Iron
Patrick asked on 12 Nov 2015, 09:43 AM

Hello,

I'm writing a custom filter for a RadGridView and it works almost perfectly.

The only problem I have is that I am calling GetDistinctValues(ColumnToPrepare, True, Nil) on the IFilterDescriptor.Prepare method, in order to know which values I must display. During the call to GetDistinctValues, the GridView runtime calls the filter expression to filter the items.

From the documentation, it seems that this overload of GetDistinctValues should filter the items with other filters, but not the one on the current column. Is there an error in the documentation or an error in the code?

Note that I've currently curcumvent the problem by using a field to "disable" my filter in this case, but it is not a "clean" solution.

1 Answer, 1 is accepted

Sort by
0
Yoan
Telerik team
answered on 16 Nov 2015, 06:32 PM
Hi Patrick,

Generally, this argument tells the method to return the distinct values for a certain column by ignoring the currently active filters of other columns.For example, if we have countries and players and we have filtered by CountryX, when we request all distinct players, if the argument is true we will get players from CountryX only. If  the argument is false we will get all distinct players. You can check the signature of GetDistinctValues method in this forum thread. You can also find links to blog posts for custom filtering and custom filter control.

Regards,
Yoan
Telerik
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 Feedback Portal and vote to affect the priority of the items
Tags
GridView
Asked by
Patrick
Top achievements
Rank 2
Iron
Iron
Iron
Answers by
Yoan
Telerik team
Share this question
or