How to select a value from a sub-collection

3 posts, 0 answers
  1. Erdem
    Erdem avatar
    22 posts
    Member since:
    Sep 2013

    Posted 01 Jul 2014 Link to this post


    Hi,

    I'm in a situation where I have a sub-collection in my GridView of a complex type and was hoping I could perform a filter like the following:

    ItemPropertyDefinition tagDefinition = new ItemPropertyDefinition("Tags.Tag", typeof(string), "Tags");
    this.RadDataFilterBlogProperties.ItemPropertyDefinitions.Add(tagDefinition);

    This is obviously not working....
    In a previous post I saw something about using a QueryableCollectionView with Linq and binding it to the DataFilter.
    ...but after doing some research I can't even find an event where I can overwrite/bypass the default filter behaviour of the datafilter.

    ---

    My current solution/workaround is adding an extra property to the collection that is bound to the GridView that has all the strings from the sub-collection combined ... and letting the DataFilter, filter on that field...  But this method is slow and not really correct.

    Thanks in advance,


  2. Erdem
    Erdem avatar
    22 posts
    Member since:
    Sep 2013

    Posted 02 Jul 2014 in reply to Erdem Link to this post


    Currently the only solution I see is using the propertychanged Event of IFilterDescriptor

    use unbound mode
    Do Not add the filterdescriptor from te DataFilter to the GridView.
    Instead create an eventhanderl for propertychanged
    In the propertychanged create a new filterdescriptor (Based on a Linq expression) and apply it to the GridView
    create a dictionary and keep the Original filterdescriptor with the new filterdescriptor together
    The Original filterdescriptor will now only be used for visual usability ... when it is deleted or emptied, look up the key in the dictionary and delete from Grid and dictionary.

    This seems to work, untill I run accros CompositeFilterDescriptor.

    The same logic should be applicable to CompositeFilterDescriptor but since this can have a recursive amount of levels of FilterDescriptors, this is really getting extremely complex ..

    in order to make it easier, I'm trying to Clone the original compositeFilterDescriptor and just modify where necessary, but the inbuilt clone functionality seems to return a Freezable type that I can't use.






  3. UI for WPF is Visual Studio 2017 Ready
  4. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 04 Jul 2014 Link to this post

    Hello,

    You can check this forum thread on a similar topic. This one may also be useful:
    DataFilter for Complex Type.

    Regards,
    Didie
    Telerik
     
    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
     
Back to Top