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

Discussion in 'ASP .Net' started by dbuchanan, Dec 19, 2005.

  1. dbuchanan

    dbuchanan Guest

    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
     
    dbuchanan, Dec 19, 2005
    #1
    1. Advertising

  2. dbuchanan

    Bart Mermuys Guest

    Hi,

    "dbuchanan" <> wrote in message
    news:...
    > 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
    >
     
    Bart Mermuys, Dec 19, 2005
    #2
    1. Advertising

  3. dbuchanan

    dbuchanan Guest

    Bart,

    Thank you. It works.

    dbuchanan
     
    dbuchanan, Dec 19, 2005
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. dbuchanan
    Replies:
    3
    Views:
    2,882
    dbuchanan
    Dec 16, 2005
  2. dbuchanan
    Replies:
    1
    Views:
    534
    arsaral
    Jul 26, 2006
  3. Filiz Duman
    Replies:
    1
    Views:
    183
    Yann-Erwan Perio
    Jan 6, 2004
  4. Noel Dolan
    Replies:
    0
    Views:
    238
    Noel Dolan
    Jul 18, 2004
  5. Bitswapper
    Replies:
    5
    Views:
    150
    Prasad, Ramit
    Aug 27, 2013
Loading...

Share This Page