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

Set QueryableEntityCollectionView with Subset of Data

1 Answer 118 Views
EntityFrameworkDataSource
This is a migrated thread and some comments may be shown as answers.
Brian
Top achievements
Rank 1
Brian asked on 18 Jul 2013, 02:51 PM
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.

1 Answer, 1 is accepted

Sort by
0
Rossen Hristov
Telerik team
answered on 22 Jul 2013, 01:12 PM
Hello,

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.

Regards,

Rossen Hristov
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
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 >>
Tags
EntityFrameworkDataSource
Asked by
Brian
Top achievements
Rank 1
Answers by
Rossen Hristov
Telerik team
Share this question
or