Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > vs2005 - Open a child form based on selected record parent form's dgv - how?

Reply
Thread Tools

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

 
 
dbuchanan
Guest
Posts: n/a
 
      12-19-2005
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

 
Reply With Quote
 
 
 
 
Bart Mermuys
Guest
Posts: n/a
 
      12-19-2005
Hi,

"dbuchanan" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) 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
>



 
Reply With Quote
 
 
 
 
dbuchanan
Guest
Posts: n/a
 
      12-19-2005
Bart,

Thank you. It works.

dbuchanan

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
If a class Child inherits from Parent, how to implementChild.some_method if Parent.some_method() returns Parent instance ? metal Python 8 10-30-2009 10:31 AM
vs2005 - Opening a child form with DGV from a parent with a DGV dbuchanan ASP .Net 1 07-26-2006 11:31 AM
vs2005 - Parent-Child dataGridViews with tableAdapters dbuchanan ASP .Net 3 12-16-2005 04:43 PM
Trojan Horse Generic DGV - How to get rid of? Scott Computer Support 1 11-28-2005 03:16 PM
Pass from parent to child, then update parent with child value... Noel Dolan Javascript 0 07-18-2004 05:52 PM



Advertisments