unbound mode

2 posts, 0 answers
  1. Rayne
    Rayne avatar
    241 posts
    Member since:
    Sep 2010

    Posted 21 Dec 2011 Link to this post

    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.
  2. Rossen Hristov
    Admin
    Rossen Hristov avatar
    2478 posts

    Posted 22 Dec 2011 Link to this post

    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 >>

  3. UI for WPF is Visual Studio 2017 Ready
Back to Top