QueryableEntityCollectionView over multiple entities?

2 posts, 0 answers
  1. Samuel
    Samuel avatar
    8 posts
    Member since:
    Jul 2014

    Posted 09 Jul 2015 Link to this post

    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?

  2. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 14 Jul 2015 Link to this post

    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
  3. UI for WPF is Visual Studio 2017 Ready
Back to Top