Automatic display of navigation property collection members

3 posts, 1 answers
  1. Craig
    Craig avatar
    113 posts
    Member since:
    Nov 2011

    Posted 21 Mar 2013 Link to this post

    I have a simple parent/child relationship between some tables in my OpenAccess model. I retrieve all the rows in the parent table and display them in a WPF RadGRidView. I now want to display the children within each parent something like this:
    ... Child 11
    ... Child 12
    ... Child 13
    ... Child 21
    ... Child 22

    I notice at runtime the navigation property collection has no members even though in the database there are children.
    How can the navigation property collection be populated and would the RadGridView automatically present them in the layout described above?


  2. Answer
    Dimitrina avatar
    3769 posts

    Posted 26 Mar 2013 Link to this post

    Hello Craig,

    I would suggest you to check the FetchStrategy class. It allows you to specify which navigation properties to be loaded along with the object that you query for. They can be defined either per query or per context. 

    In this set of documentation articles you can find a variety of examples regarding the definition and the usage of fetch plans. Then you need to define the Hierarchy for the RadGridView and set the PropertyRelation as demonstrated in this help article.

    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. Craig
    Craig avatar
    113 posts
    Member since:
    Nov 2011

    Posted 27 Mar 2013 Link to this post

    Thanks for pointing me in the right direction. That works well.
Back to Top