vs2005 - Parent-Child dataGridViews with tableAdapters

  • Thread starter Thread starter dbuchanan
  • Start date Start date
D

dbuchanan

Hello,

How do I create a Parent-Child relationship between two DataGridView in
a form using TableAdapters. The two tables already have a relationship
defined in the dataset.

What event do I use to update the child dgv? The RowEnter event?

Thank you,
dbuchanan
 
after you have created DataSet in VS2005 and if you Database has the
parent Child relationship then you will be able to see the child Table
under the Parent table(like a field) in the datasource of VS. Change
both(parent and child) view to DataGridView and drag both to the form.
make sure that you drag-drop the child table which is displayed as a
field of the parent.
Regards,
Naveed Ahmad Bajwa
http://bajoo.blogspot.com/
 
Hello Bajoo,

And there the mystery;

My solution has two projects. One is 'QmsDataLayer' and the other is
'QmsUserInterface'.

When I am in 'QmsDataLayer' were the dataset is located and I go to the
"DataSouce" window I can see the child table under the parent table
(like a field) just as you describe.
[-] DataSet1
[-] DataSet1.Table1
[abc] field1
[abc] field2
[abc] field3
[abc] field4
[+] Table2
[+] Table2


However, When I am in 'QmsUserInterface' where the dataset is
referenced, and I go the the "DataSource" window it looks different;
[-] {} QmsDataLayer
[+] DataSet1
[-] DataSet1.Table1
[abc] field1
[abc] field2
[abc] field3
[abc] field4
[+] DataSet1.Table2

I don't see any child tables (like a field) under the parent table.

I can't believe that vs2005 doesn't allow relationships when the
dataset is reference, so how do I get the relatiohship for a referenced
dataset? And how do I link a child datagridview to a parent datagrid
view?

Thank you,
dbuchanan
 
Bajoo,

Wait, I didn't look close enough. It *is* there;
[-] {} QmsDataLayer
[-] DataSet1
[-] DataSet1.Table1
[abc] field1
[abc] field2
[abc] field3
[abc] field4
[+] Table2
[+] Table2
[-] DataSet1.Table1
[abc] field1
[abc] field2
[abc] field3
[abc] field4
[+] DataSet1.Table2

Now I'll try to follow your suggestion

Thank you,
dbuchanan
 
Back
Top