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
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.
Ross
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
Best regards,
Patrik Edberg
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.
Ross
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
Best regards,
Patrik Edberg