3 Datagridviews bound

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?Utf-8?B?QWRl?=

    #1

    3 Datagridviews bound

    Hi,
    I have three datagridview controls bound to three tables in a dataset. Two
    relations exist to join the three tables. Ie Master to Child1 and then Child
    1 to Child 2.
    The Master and Child 1 DataGridView (DGV) work fine with the rows changing
    in Child1 to relect the Master. But...
    The 3rd DGV (Child 2) lists data for the first row of Child 1 and does not
    change when Child 2 data changes. Ok I know I am doing something wrong, but
    what? Any help would be appreciated.

    ps I am making sure that all have the same binding context by explicitly
    setting even though it gets it from the container.
    --
    Big thank you for your help.
  • Nicholas Paldino [.NET/C# MVP]

    #2
    Re: 3 Datagridviews bound

    Ade,

    When you are binding to child tables, and only want to see the related
    records for the selected record in the parent table, you need to bind to the
    DataRelation, and not the child DataTable.


    --
    - Nicholas Paldino [.NET/C# MVP]
    - mvp@spam.guard. caspershouse.co m

    "Ade" <ade@nospam.nos pamwrote in message
    news:B2884C56-E6CA-4296-B518-DB295B9EFD61@mi crosoft.com...
    Hi,
    I have three datagridview controls bound to three tables in a dataset. Two
    relations exist to join the three tables. Ie Master to Child1 and then
    Child
    1 to Child 2.
    The Master and Child 1 DataGridView (DGV) work fine with the rows changing
    in Child1 to relect the Master. But...
    The 3rd DGV (Child 2) lists data for the first row of Child 1 and does not
    change when Child 2 data changes. Ok I know I am doing something wrong,
    but
    what? Any help would be appreciated.
    >
    ps I am making sure that all have the same binding context by explicitly
    setting even though it gets it from the container.
    --
    Big thank you for your help.

    Comment

    Working...