CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2005
    Posts
    1

    Thumbs up Datagrid inside another datagrid - Hierarchial Fashion

    Do tell me how to make a usercontrol that look in a hierarchial fashion
    (tree like structure) with atleast 3 levels wherein each datagrid has another datagrid.

  2. #2

    Re: Datagrid inside another datagrid - Hierarchial Fashion

    Basically inside one of the column definitions, just put a new datagrid. You can either do this in the page or generate them dynamically.

  3. #3
    Join Date
    Jan 2004
    Location
    Houston
    Posts
    54

    Re: Datagrid inside another datagrid - Hierarchial Fashion

    Basically inside one of the column definitions, just put a new datagrid. You can either do this in the page or generate them dynamically.
    the only problem with this method is that the 2nd datagrid has to be entirely contained within 1 column, so space is an issue. If he were to do that yet another time, the page would look ugly and it would defeat the purpose of the hierarchical structure.

    What is ideal is for the 2nd datagrid to occupy the entire next row, only indented 10 pixels or so.

    There are 2 ways to achieve this (that I know of)
    1) you could simulate a datagrid-like appearance with a repeater, and just have a hidden datagrid inside another table row. I have a [+] / [-] toggle button to toggle the visibility of the datagrid.

    2) (slightly harder at first, but ultimately cooler) is to programatically insert a new row into the datagrid where the 2nd datagrid will be inserted, and then merge all of the cells together. This does take some time to get going at first.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured