Set QueryableEntityCollectionView with Subset of Data

2 posts, 0 answers
  1. Brian
    Brian avatar
    17 posts
    Member since:
    Jun 2011

    Posted 18 Jul 2013 Link to this post

    Is there any means of setting the QueryableEntityCollectionView to a subset of data using a linq query or some other means?

    For example the following code will include all recurds in tbUser
    New QueryableEntityCollectionView(Of DataModelEF.tbUser)(DbContext, "tbUsers")

    I only want active users to be included based on a flag.  It's preferable if the user is blind to this filter in that the column on the grid doesn't show that it's been filtered.

    I see that there is another constructer that uses ObjectQuery but I can't get my head around how this works and I can't seem to find any examples.

    Any help is appreciated.

  2. Rossen Hristov
    Rossen Hristov avatar
    2478 posts

    Posted 22 Jul 2013 Link to this post


    To filter the data, you can add a FilterDescriptor to the FilterDescriptors collection of the QECV.

    The FilterDescriptor has three important properties -- Member, Operator and Value.

    The Member will be the name of the property, the Operator will be IsEqualTo and the Value would be true or false if the prop is boolean. You get the idea.

    Or you can add the same filter descriptor to RadGridView -- it will automatically synchronize it with the QECV it is bound to.

    More about programmatic filtering you can learn from this article.


    Rossen Hristov
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  3. DevCraft R3 2016 release webinar banner
Back to Top