Parent Child Relationship

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!!!!!
 
G

Guest

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...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top