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

FilterDescriptors to Predicate

1 Answer 72 Views
DataFilter
This is a migrated thread and some comments may be shown as answers.
Roland
Top achievements
Rank 1
Roland asked on 15 Aug 2011, 10:48 AM
Hi,

What is the easiest way to turn my RadDataFilter's FilterDescriptors into a Predicate<object>? 

I noticed that the RadDataFilter.FilteredSource has a property called Filter (of type Predicate<object>). I want to have something similar but the classes used are marked internal. Note that I have the DataFilter in unbound mode, hence the ItemsSource and FilteredSource properties are null.

Thanks,
Roland

1 Answer, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 18 Aug 2011, 07:52 AM
Hi Roland,

The FilterDescriptor<T> allows you to directly plug a predicate that determines which items are filtered. You just need to set a lambda to the FilteringExpression property like so:

var descriptor = new FilterDescriptor<Employee> { FilteringExpression = e => prospects.Contains(e) };

where 'prospects' is a collection of Employees.

Greetings,
Didie
the Telerik team

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

Tags
DataFilter
Asked by
Roland
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Share this question
or