vs2005 - Open a child form based on selected record parent form's dgv - how?

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

dbuchanan

Hello,

I want to open a child form based on the record selected in a
dataGridView of the parent form.

I want the child form to open with a populated child table based on the
selected parent record.

How do I get the ID of the selected record in the parent form's
dataGridView so I can use it in filling the child form's dataGridView?
I plan to use the FillBy of the tableAdapter.

Thank you,
dbuchanan
 
Hi,

dbuchanan said:
Hello,

I want to open a child form based on the record selected in a
dataGridView of the parent form.

I want the child form to open with a populated child table based on the
selected parent record.

How do I get the ID of the selected record in the parent form's
dataGridView so I can use it in filling the child form's dataGridView?

If there is a BindingSource you could use BindingSource.Current, eg.:

Dim drv As DataRowView = _
DirectCast(YourBindingSource.Current, DataRowView)

Dim id As Object = _
drv("your_id_columnname")
I plan to use the FillBy of the tableAdapter.
So i assume you already know how to add a query with parameter to a
TableAdapter.

HTH,
Greetings
 
Back
Top