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

LogicalOperator gone?

4 Answers 73 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Patrik
Top achievements
Rank 1
Patrik asked on 13 Apr 2012, 01:31 PM
Hello Telerik!

I have been using the DistinctValuesFilterDescriptor.LogicalOperator property to present current filters for end users in a human readable format. But since the recent releases, you have removed this property from the IDistinctValuesFilterDescriptor interface, and looking in the source code I can see that it's gone from there too. I need this property to properly show our users what filtering settings is currently active. How can I retrieve the logical operator for a distinct values filter now?

Best regards,
Patrik Edberg

4 Answers, 1 is accepted

Sort by
0
Accepted
Rossen Hristov
Telerik team
answered on 13 Apr 2012, 02:05 PM
Hello,

The initial implementation which was made almost 3 years ago was flawed in many aspects.

We had to refactor the code to use interfaces because we were exposing many things that one should not have been able to mess with in the first place. Many people have been messing with things that they are not supposed to and were breaking the column filtering logic. For example -- setting this logical operator would break the entire filtering logic for the column. That is why we have decided to fix this and hide stuff behind interfaces.

The new interface IDistinctValuesFilterDescriptor  does not have such a property since one is not supposed to be able to change it. That is why the actual implementation is hidden behind an interface.

The complete release notes can be found here.

The distinct values are ALWAYS combined with the OR operator so you can safely assume that the logical operator will always be OR. That is the whole meaning of distinct values, i.e. it is Germany OR USA OR UK OR Spain and so on. If they are combined with an AND -- no results will be returned at all.

I hope this makes sense. Let me know if there are problems with the upgrade.

All the best,
Ross
the Telerik team

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

0
Patrik
Top achievements
Rank 1
answered on 13 Apr 2012, 02:22 PM
Yes, this makes sense. I also noted you removed the "Member" property from the OperatorValueFilterDescriptorBase class. Was it because of the same reason?

Best regards,
Patrik Edberg
0
Accepted
Rossen Hristov
Telerik team
answered on 13 Apr 2012, 02:33 PM
Hello,

This is because we implemented filtering for our expression column which has no notion of Member. 

That is why we extracted all common logic for the two kinds of columns to the base abstract class OperatorValueFilterDescriptorBase.

In case your column is a normal GridViewDataColumn (i.e. which has a DataMemberBinding), you can safely cast the abstract OperatorValueFilterDescriptorBase to a FilterDescriptor which has a Member.

In case your column is a GridViewExpressionColumn, you can safely cast the OperatorValueFilterDescriptorBase to a LambdaFilterDescriptor which has a LambdaExpression instead of a Member.

Long story short, we extracted everything except for the Member property from the FilterDescriptor class up to the base abstract OperatorValueFilterDescriptorBase class so that the new LambdaFilterDescriptor can derive from it and reuse its code.

Let me know if I can be of any further assistance.

Greetings,
Ross
the Telerik team

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

0
Patrik
Top achievements
Rank 1
answered on 13 Apr 2012, 02:58 PM
Okay, thanks for the info!

Best regards,
Patrik Edberg
Tags
GridView
Asked by
Patrik
Top achievements
Rank 1
Answers by
Rossen Hristov
Telerik team
Patrik
Top achievements
Rank 1
Share this question
or