By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,829 Members | 1,829 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,829 IT Pros & Developers. It's quick & easy.

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

P: n/a
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

Dec 19 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Hi,

"dbuchanan" <db*********@hotmail.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
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

Thank you,
dbuchanan

Dec 19 '05 #2

P: n/a
Bart,

Thank you. It works.

dbuchanan

Dec 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.