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

FilterDescriptor on two members

4 Answers 78 Views
DataFilter
This is a migrated thread and some comments may be shown as answers.
developer
Top achievements
Rank 1
developer asked on 16 Jul 2014, 12:29 PM
Hi

I need to give to the user the possibility to build filter not only between a Member and a value (like Column1 = 10) but also between two members (like Column1 >= Column2).

How could I do?

4 Answers, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 17 Jul 2014, 01:18 PM
Hello,

This FilterDescriptors collection can contain CompositeFilterDescriptor or FilterDescriptor instances. The CompositeFilterDescriptor contains other descriptors and combines them with a logical operator of OR or AND. The simple FilterDescriptor class is a leaf of the tree and contains a Member, Operator, Value, MemberType.
I am afraid there is not a way to compare between two members.

Regards,
Didie
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
0
developer
Top achievements
Rank 1
answered on 17 Jul 2014, 01:31 PM
I'm developing a workaround to implement this feature.

Basically, I created my own EditorTemplate where the user can choose to insert a static value or select an item from a Combobox which is populated with che Member of my object.

The only problem that I found is that I have to cast each member from my datasource to a string member. Because if I create a filter on a Integer member the value can't be a string (in my situation the value would be the member name, which is a string). But this solution isn't perfect because if all the Member are string I can't use every comparision operator, but only the ones that work with the string type. What can you suggest to me? Are there any way to avoid this limitation?









































































0
developer
Top achievements
Rank 1
answered on 17 Jul 2014, 01:33 PM
Sorry for the white spaces, it has been a mistake
0
Dimitrina
Telerik team
answered on 18 Jul 2014, 02:34 PM
Hello,

Basically you can check the Create Custom Filter Editors article. If this is not what you need, may I ask you to open a new support ticket and send me a demo project illustrating your attempt?

Regards,
Didie
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
Tags
DataFilter
Asked by
developer
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
developer
Top achievements
Rank 1
Share this question
or