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

QueryableEntityCollectionView over multiple entities?

1 Answer 72 Views
DataServiceDataSource
This is a migrated thread and some comments may be shown as answers.
Samuel
Top achievements
Rank 1
Samuel asked on 09 Jul 2015, 07:53 PM

I want to use QueryableEntityCollectionView as the datasource for a GridView.  However, I want to show columns from several different tables in this Grid and have them all be filterable/sortable.  I realize I could create a view in my database and and entity to map that view but I want to avoid that if at all possible.

 

for example:

public class USER
 
{
 
     public int UserID {get;set;}
 
     public String UserName {get;set;}
 
     public int JobCode {get;set;}
 
}
 
public class JOB
 
{
 
     public int JobCode {get;set;}
 
     public String JobDescription {get;set;}
 
};

 

Now suppose I want my grid to contain columns for UserName and JobDescription.  How would I do this without creating a view?

1 Answer, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 14 Jul 2015, 12:10 PM
Hi Samuel,

As it turns out QueryableEntityCollectionView itself cannot handle such inter connections between entities.
What QueryableEntityCollectionView does on filtering/sorting is simply add Where and OrderBy clauses to your LINQ query so that you don't have to do this by hand. In other words, it knows how to read for example RadGridView.FilterDescriptors and based on the information stored in them build a Where clause to build the proper query.

Regards,
Dimitrina
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
DataServiceDataSource
Asked by
Samuel
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Share this question
or