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

Automatic display of navigation property collection members

2 Answers 60 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Craig
Top achievements
Rank 1
Craig asked on 21 Mar 2013, 12:28 PM
Hi
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:
Parent1
... Child 11
... Child 12
... Child 13
Parent2
... Child 21
... Child 22
etc.

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?

Thanks
Craig


2 Answers, 1 is accepted

Sort by
0
Accepted
Dimitrina
Telerik team
answered on 26 Mar 2013, 01:02 PM
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.

Regards,
Didie
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Craig
Top achievements
Rank 1
answered on 27 Mar 2013, 02:21 PM
Thanks for pointing me in the right direction. That works well.
Tags
GridView
Asked by
Craig
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Craig
Top achievements
Rank 1
Share this question
or