Filter QueryableCollectionView by List<> field

2 posts, 0 answers
  1. Alexander
    Alexander avatar
    9 posts
    Member since:
    Apr 2012

    Posted 25 Apr 2012 Link to this post

    Hello.
    I have next structure of code:

    ObservableItemCollection<Item> Items;
    QueryableCollectionView CollectionView = new QueryableCollectionView(Items);
    GridView grdMain;
    grdMain.ItemsSource = CollectionView;

    class Item
    {
    public strng Name;
    public List<Item> Child;
    }

    I need to filter CollectionView collection such as: Item => Child.Any(a => a.ID == 100).
    In other words: Select Item Where Child contain Item with ID == 100.

    How can I do it? I thought to use FilterDescriptor, but don't know how to create expression.
  2. Rossen Hristov
    Admin
    Rossen Hristov avatar
    2477 posts

    Posted 25 Apr 2012 Link to this post

    Hello,

    Your only chance would be to use the generic version of the FilterDescriptor where you can write any valid lambda expression that would be used for filtering.

    You can also take a look at my blog post for a similar implementation.

    I hope this helps.

    Regards,
    Ross
    the Telerik team

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

Back to Top