In order to protect the link between the master and the detail grids, I suggest you the following approach:
For the purpose of the example, let's assume that the database you use is Northwind
and that you have a WinForms project and an OpenAccess Class Library project. The WinForms project contains the form that will display the grids and the OpenAccess Class Library project contains the entity model. Let's also assume that the WinForms project is set up to consume the model and your solution is built.
1) Select the WinForms project and from the Project
menu of Visual Studio, select Add New Data Source...
2) From the Choose a Data Source Type
page of the wizard, select Object
and click Next
3) Expand the node that corresponds to the name of the model project and select the Category
4) Click Finish
5) Open the Data Source window
of Visual Studio and pin it wherever is suitable for you
6) Expand the node so that the Category object is visible
7) Open the form in design view
8) Drag-and-drop the Category
object on the form. It will automatically add the necessary grid and the binding source
node in the Data Source window and drag-and-drop the Products
object. Here again Visual Studio will automatically add the necessary grid and the binding source
the code behind of the form (F7) and add an Imports
clause to the namespace of the model project
11) Modify the code as shown in the snippet:
the solution and from now on the functionality that you are looking for will be available
Please find attached a small sample project where the process I described is implemented. In it you can also find how to implement features like adding in the database through the grid.
I hope that helps. If you experience problems with the solution I provided or have additional questions, do not hesitate to get back to us.
the Telerik team
Q3'12 SP1 of OpenAccess ORM packs Multi-Table Entities mapping support. Check it out.