GetDistinctValues for a custom filter

2 posts, 0 answers
  1. Patrick
    Patrick avatar
    382 posts
    Member since:
    Aug 2012

    Posted 12 Nov 2015 Link to this post


    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.

  2. Yoan
    Yoan avatar
    1128 posts

    Posted 16 Nov 2015 Link to this post

    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.

    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
Back to Top