Nested datagrids in windows forms (again)

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • John Jasobs

    Nested datagrids in windows forms (again)

    I know this has been asked before but I have not seen it
    answered. How would one implement nested datagrids in
    windows forms based on the table relationships within a
    dataset? Or, is there some setting that lets you
    automatically display the details table (instead of the
    relationship name) on the new expanded row of a datagrid?
    I have seen it for ASP.NET, but is this doable for windows
    forms?

    Thanks in advance,
    John
  • One Handed Man \( OHM - Terry Burns \)

    #2
    Re: Nested datagrids in windows forms (again)

    Sort of.

    If you create a relationship between say Order and OrderDetails table ( 1 to
    many ), where OrderDetails has the foreign key. Then by default this will
    show with navigation controls in a DataGrid, when you expand the order the
    details will show.


    --

    OHM ( Terry Burns )
    . . . One-Handed-Man . . .

    Time flies when you don't know what you're doing

    "John Jasobs" <jbjacobs@msn.c om> wrote in message
    news:2b7c101c46 850$006751a0$a4 01280a@phx.gbl. ..[color=blue]
    > I know this has been asked before but I have not seen it
    > answered. How would one implement nested datagrids in
    > windows forms based on the table relationships within a
    > dataset? Or, is there some setting that lets you
    > automatically display the details table (instead of the
    > relationship name) on the new expanded row of a datagrid?
    > I have seen it for ASP.NET, but is this doable for windows
    > forms?
    >
    > Thanks in advance,
    > John[/color]


    Comment

    • John Jasobs

      #3
      Re: Nested datagrids in windows forms (again)

      When you expand, the relationship name shows as a link.
      You then have to click on that link to get to the detail
      table. Is there a way to bypass that intermediate step.
      Have the detail grid displayed in the row of a master grid
      (nested grids). In windows forms, keep in mind.
      [color=blue]
      >-----Original Message-----
      >Sort of.
      >
      >If you create a relationship between say Order and[/color]
      OrderDetails table ( 1 to[color=blue]
      >many ), where OrderDetails has the foreign key. Then by[/color]
      default this will[color=blue]
      >show with navigation controls in a DataGrid, when you[/color]
      expand the order the[color=blue]
      >details will show.
      >[/color]

      Comment

      • One Handed Man \( OHM - Terry Burns \)

        #4
        Re: Nested datagrids in windows forms (again)

        Not in the same grid, however, you can have a secondary grid bound to the
        relation, this way the master selected row changes, so do the children
        displayed in the details.

        --

        OHM ( Terry Burns )
        . . . One-Handed-Man . . .

        Time flies when you don't know what you're doing

        "John Jasobs" <jbjacobs@msn.c om> wrote in message
        news:2bf2901c46 909$e5083900$a5 01280a@phx.gbl. ..[color=blue]
        > When you expand, the relationship name shows as a link.
        > You then have to click on that link to get to the detail
        > table. Is there a way to bypass that intermediate step.
        > Have the detail grid displayed in the row of a master grid
        > (nested grids). In windows forms, keep in mind.
        >[color=green]
        > >-----Original Message-----
        > >Sort of.
        > >
        > >If you create a relationship between say Order and[/color]
        > OrderDetails table ( 1 to[color=green]
        > >many ), where OrderDetails has the foreign key. Then by[/color]
        > default this will[color=green]
        > >show with navigation controls in a DataGrid, when you[/color]
        > expand the order the[color=green]
        > >details will show.
        > >[/color][/color]


        Comment

        Working...