Parent Child Relationship

  • Thread starter Thread starter Sue
  • Start date Start date
S

Sue

Hi
I am having two tables Parent and Child, I have created a
relation Rel between them. When I bind two datagrids, 1 to
Parent and other to Parent.rel using setdatabindings.
The child Datagrid does displays only 1 row with the key
field and all other columns as null value.
If I bind the child grid to CHild table (not relation), it
displays all the child records for all the rows in the
parent table.
I am using OLEDB provider and my database is TERADATA
Can somebody Help!!!!!
 
Okay.

Since you don't say it I am assuming that you want to show
the child data rows for a selected master record when you
click on an appropriate parent datagrid cell/row.

First off both tables should be in the same dataset, not
separate entities and the relation added to the dataset.

Secondly, in the appropriate event handling logic add code
to create a dataview of the selected parent record.

Now from that dataview, create a child dataview
referencing the relation you created.

Lastly use this child dataview to display/edit your child
datagrid.

Hope this helps...
 
Back
Top