We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Platform : Windows Forms
|
Category : Datagrid

How can I bind two datagrids in a Master-Detail relationship?

Please download this sample before reading the rest of this FAQ. Looking through the sample will help follow the description.

simpledata2.zip

What this boils down to is this:
1) Load both Master and Details queries in a dataset.
2) Bind the master data grid to the Master dataset table.
3) Create a relationship that describes how the two tables relate to each other. A primary key foreign key relationship is defined by two attributes.
The primary key column in the master table
The foreign key column in the details table
The created relationship is added to the dataset.
4) Set the data member for the details table to be the name of relationship that was added to the dataset.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.