Datagrid Parent/Child relationships???

  • Thread starter Thread starter Darryn Ross
  • Start date Start date
D

Darryn Ross

Hi,

How do i get my datagrid to display the contents of two related tables setup
in my access database, so i can see the plus/minus sign to expand retract
the Child details?

Regards

Darryn
 
Hi Darryn,

Create a DataSet, add the datatables to the DataSet, and then create a
DataRelation linking the tables and add the relation to the DataSet's
Relations collection.
Next, bind the DataGrid to the created DataSet.
 
Hi Dmitiry,

Thanks, i managed to work it out however i am having a tedious problem now.
When my data grid appears i have a plus sign against both my tables with no
records showing until i click on one of them. How do i get the grid to show
the parent records and hide the child ones by default instead of hiding
both??

Thanks

Darryn


Dmitriy Lapshin said:
Hi Darryn,

Create a DataSet, add the datatables to the DataSet, and then create a
DataRelation linking the tables and add the relation to the DataSet's
Relations collection.
Next, bind the DataGrid to the created DataSet.

--
Sincerely,
Dmitriy Lapshin [C# / .NET MVP]
Bring the power of unit testing to the VS .NET IDE today!
http://www.x-unity.net/teststudio.aspx

Darryn Ross said:
Hi,

How do i get my datagrid to display the contents of two related tables setup
in my access database, so i can see the plus/minus sign to expand retract
the Child details?

Regards

Darryn
 
Back
Top