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

Tie an Editor to a Filter Descriptor

1 Answer 20 Views
DataFilter
This is a migrated thread and some comments may be shown as answers.
WILLIAM
Top achievements
Rank 1
WILLIAM asked on 08 Oct 2012, 09:16 PM
Bare with me, this will take a bit to explain.  I need to be able to reference a specific editor instance to its specific filter descriptor instance.

Our users have become used to a filter control that recognizes a lot of operators that aren't supported by Telerik.  Specifically, in this case, the IsAnyOf and NotIsAnyOf operators.  I have overcome this problem by completely handling this differently with a control that I built that sets the IsAnyOf or NotIsAnyOf operators and the values the user has chosen.  All of this works fine, but here's the problem:

If the user removes a filter descriptor, there is no way for me to determine what specific editor was being used, and therefore I cannot remove the data structure that I have built which holds the operator and values that the user has chosen.  I thought the answer was to put a key in the Tag property of the Editor, but unfortunately this doesn't work, because when the FitlerDescriptorCollection Changed event fires, the descriptor that was removed has no reference (and as far as I can tell), no way to figure out what the editor was so that I can retrieve the key from that Tag property.  

I also thought about adding the key to the filter descriptor itself when it's created, but there is no Tag property on that, and again, there is not way to get the editor either.

Any ideas or suggestions on how to accomplish this?

Thanks for your help!!

1 Answer, 1 is accepted

Sort by
0
Rossen Hristov
Telerik team
answered on 09 Oct 2012, 07:16 AM
Hi,

I am afraid that the information that your require is not available at the moment the user deletes a filter.

But even if it was, how is our data engine going to handle a filter operator which it does not support? In other words, what will be written in the respective FilterDescriptor (Member-Operator-Value) before it is used for filtering by the data engine. The data engine builds a LINQ query based on the stuff written in Member-Operator-Value, for example:

var result = sourceCollection.Where(customer => customer.Name == "John");

The data engine supports only a finite set of FilterOperator's and know what LINQ queries to compose when it encounters one of them.

How are your custom operators going to be supported, i.e. who is going to create the approapriate LINQ query?

Kind regards,
Ross
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
DataFilter
Asked by
WILLIAM
Top achievements
Rank 1
Answers by
Rossen Hristov
Telerik team
Share this question
or