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

Filter QueryableCollectionView by List<> field

1 Answer 87 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Alexander
Top achievements
Rank 1
Alexander asked on 25 Apr 2012, 01:43 PM
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.

1 Answer, 1 is accepted

Sort by
0
Rossen Hristov
Telerik team
answered on 25 Apr 2012, 02:50 PM
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 >>

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