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

Apply complex filters to RadGridView

1 Answer 19 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Hadrien
Top achievements
Rank 1
Hadrien asked on 25 Mar 2014, 10:37 AM
Hi,

From what have seen it's easy to apply this kind of filter to a RadGridView (Country and Capital are the columns):
Country.Contains("France") AND (Capital.Contains("Paris") OR Capital.Contains("London")) -> this will give us 1 row (France, Paris)

What about if I want to do:
Country.Contains("France") OR (Capital.Contains("Paris") OR Capital.Contains("London")) -> so I would get 2 row (France, Paris; England, London)

I read the below pages but I couldn't find a solution for this. Can I do it in some how?
http://www.telerik.com/help/wpf/radgridview-filtering-icolumn-filter-descriptors.html
http://www.telerik.com/help/wpf/gridview-filtering-programmatic.html

Thanks

1 Answer, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 25 Mar 2014, 11:53 AM
Hello,

There are two options how you could apply a filter.
Through:
1. IColumnFilterDescriptor.DistinctFilter and 
2.IColumnFilterDescriptor.FieldFilter.
Adding distinct values to the DistinctFilter allows you to filter on many values with OR logical operator. On the other side you can filter on two values through specifying
countryFilter.FieldFilter.Filter1 and
countryFilter.FieldFilter.Filter2.

In that case you can specify the logical operator to be AND or OR.
countryFilter.FieldFilter.LogicalOperator = Telerik.Windows.Data.FilterCompositionLogicalOperator.Or;

Regards,
Didie
Telerik
 

Build cross-platform mobile apps using Visual Studio and .NET. Register for the online webinar on 03/27/2014, 11:00AM US ET.. Seats are limited.

 
Tags
GridView
Asked by
Hadrien
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Share this question
or