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

Hierarchical Grids using OpenAccess ObjectView

2 Answers 93 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Axe
Top achievements
Rank 1
Axe asked on 14 Jul 2009, 02:46 AM
I'm new to Winforms & OpenAcess and want to try the hierarchical grid functionality using OpenAccess and ObjectViews. Is this possible?. I started reading the coarseware for Telerik RadControls for Winforms but it uses Datasets. Having an asp.net background I'm not too keen on Datasets. I read online help for OpenAccess ObjectViewObjectProvider but can't see how to get child collections. Maybe this should be posted in OpenAccess but if you can provide info or sample that would be great.

2 Answers, 1 is accepted

Sort by
0
Accepted
Zoran
Telerik team
answered on 17 Jul 2009, 10:09 AM
Hello Axe,

In order to build hierarchy with Telerik RadGridView and OpenAcess windows forms components, you should do the following steps:
  • Create an ObjectProvider and ObjectView that load the objects from the root persistent type.(e.g. Order)
  • Create another ObjectProvider and ObjectView that load the persistent object that the child collection contains(e.g. OrderDetail)
  • Bind the RadGridView to the first objectView datasource.
  • Create a gridviewTemplate that is bound to the second objectView dataSource
  • Define the relation between the master and detail grid templates(ChildColumnNames and ParrentColumnNames have the value of the column that defines the relation - OrderID)
We admit it  is a bit tricky at this stage. A Knowledge Base article will be provided soon in the form of a detailed walkthrough for our customers.

We are sending you a sample project to make it easier for you to understand the workflow. It just requires the Northwind database on our machine to run properly.
 

Kind regards,
Zoran
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Axe
Top achievements
Rank 1
answered on 18 Jul 2009, 03:29 AM
Thank you for the sample. It was very easy. I tried on many different databases and always works as expected.

One thing I couldn't work out is creating a  many-to-many relationship in the Grid such as in Northwind Employees and their Territories. I used 2 ObjectViews, 1 with Employees and the other with Territories and created the relationship on the EmployeeID for both ends but it's not quite right.
Can you provide some detail on how that could be achived?
Tags
GridView
Asked by
Axe
Top achievements
Rank 1
Answers by
Zoran
Telerik team
Axe
Top achievements
Rank 1
Share this question
or