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

Adding custom distinct values

3 Answers 80 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Stephan
Top achievements
Rank 1
Stephan asked on 16 Apr 2012, 02:42 PM
Within DistinctValuesLoading(), I added 3 new strings to distinct values: [2], [4] and [6].
Their purpose is to filter by length, e.g. [2] should only show rows that have a string of length 2 in this column.

Is their any way to achieve this in Filtering() event ?
Or is their another way to reach my goal ?

3 Answers, 1 is accepted

Sort by
0
Stephan
Top achievements
Rank 1
answered on 20 Apr 2012, 08:39 AM
My issue is still open, can anybody please help ?
0
Rossen Hristov
Telerik team
answered on 20 Apr 2012, 10:14 AM
Hello,

The DistinctValuesLoading event is meant solely for limiting the amount of distinct values displayed and for nothing else. You are not supposed to add new random distinct values, since the data engine has no way of knowing what to do with them. 

To achieve such a custom functionality, you will need to develop your very own custom filtering control if you want to perform custom filtering. 

Kind regards,
Ross
the Telerik team

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

0
Stephan
Top achievements
Rank 1
answered on 20 Apr 2012, 10:50 AM
Hello Ross,

    since the data engine has no way of knowing what to do with them.

I see. My (bad) idea was to grab my "custom distinct value" later and interpret it myself.


A new filtering control would be too much work as the users want distinct values and the new criterias on top.

I guess I'll introduce a new column B and put in there the length of values from old column A.
Then anybody can filter by [2], [4] oder [6]...

Thanks for your support !
Tags
GridView
Asked by
Stephan
Top achievements
Rank 1
Answers by
Stephan
Top achievements
Rank 1
Rossen Hristov
Telerik team
Share this question
or