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

unbound mode

1 Answer 17 Views
DataFilter
This is a migrated thread and some comments may be shown as answers.
Rayne
Top achievements
Rank 1
Rayne asked on 21 Dec 2011, 08:16 PM
I'm would like to use the Data Filter in unbound mode in my mvvm app. User uses the DataFilter to build the criteria, then clicks a button to perform the search. Cancel and clear buttons will also be provided to cancel a search in progress and to clear the datafilter of all filter descriptors.

Can I build my ItemPropertyDefinitions in the viewmodel and bind this collection to the control on the view? If so, what is the proper collection/property I need to use to get this to work.

Also how do I get the collection of filter descriptors back to the viewmodel so that it can create a query. I'm guessing my view needs some code behind to make this work properly.

1 Answer, 1 is accepted

Sort by
0
Rossen Hristov
Telerik team
answered on 22 Dec 2011, 10:32 AM
Hi,

You can use the ItemPropertyDefinitions property of RadDataFilter to add the ItemPropertyDefinition's. Since this property is a collection property it is read-only, you cannot assign an whole new instance to it. You will have to add individual ItemPropertyDefinitions in code-behind or in XAML.

The FilterDescriptors property of RadDataFilter contains the FilterDescriptors. The same applies for this collection as well. You can iterate over this collection and read what is written in the descriptors. Please note that they can be in a hierarchy, i.e. you may encounter CompositeFilterDescriptors.

I hope this helps.

Greetings,
Ross
the Telerik team

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

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