Displaying Hierarchical Data in a datagrid?


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 4 of 4

Thread: Displaying Hierarchical Data in a datagrid?

  1. #1
    denny moore Guest

    Displaying Hierarchical Data in a datagrid?


    Is there any way to create hierarchical data in the new datagrid. Since the
    DataGrid does not support adding individual rows, I am limited to merging
    multiple datasets together. However, there is no way to sort the dataset
    programatically before I bind it to the grid, so the merging of multiple
    datasets does me no good. I tried to use a dataview to sort the data, but
    the dataview does not have the merge method. Can Somebody please help me?

    Thanks,
    denny.

  2. #2
    Jeff Johnson Guest

    Re: Displaying Hierarchical Data in a datagrid?


    "denny moore" <dmoore@avioninc.com> wrote:
    >
    >Is there any way to create hierarchical data in the new datagrid. Since

    the
    >DataGrid does not support adding individual rows, I am limited to merging
    >multiple datasets together. However, there is no way to sort the dataset
    >programatically before I bind it to the grid, so the merging of multiple
    >datasets does me no good. I tried to use a dataview to sort the data, but
    >the dataview does not have the merge method. Can Somebody please help me?
    >
    >Thanks,
    >denny.


    A Brute force approach: Create one dataset for your data-- define the columns
    however you want them to look. Cycle through each of the rows of in your
    other DataSets and then manually add each of their rows to your main dataset.
    Viola.

    These links may help put you on the trail of coming up with a more elegant
    soilution:


    http://www.dotnet247.com/247referenc.../11/58388.aspx

    http://msdn.microsoft.com/msdnmag/is...a/default.aspx

    http://www.syncfusion.com/FAQ/WinFor...c44c.asp#q780q

  3. #3
    Phil Weber Guest

    Re: Displaying Hierarchical Data in a datagrid?

    > Is there any way to create hierarchical data in
    > the new datagrid?


    Denny: Windows Forms or Web Forms?
    --
    Phil Weber



  4. #4
    Guest

    Re: Displaying Hierarchical Data in a datagrid?


    "denny moore" <dmoore@avioninc.com> wrote:
    >
    >Is there any way to create hierarchical data in the new datagrid. Since

    the
    >DataGrid does not support adding individual rows, I am limited to merging
    >multiple datasets together. However, there is no way to sort the dataset
    >programatically before I bind it to the grid, so the merging of multiple
    >datasets does me no good. I tried to use a dataview to sort the data, but
    >the dataview does not have the merge method. Can Somebody please help me?
    >
    >Thanks,
    >denny.



    When you say "Hierarchical" I am lead to think you are talking about parent-child
    relationships between primary and secondary data that you need to see in
    a hierarchy. If this is correct... then you can easy display this in a data
    grid by creating the relationships between datatables and then binding these
    table to the grid. The grid will then display "+" tree type indicators where
    child data exists in the grid.

    You'll need to bind the grid to the tables with the function "SetDataBindings"
    and you'll want to add a "TablesStyle" to the grid that will set up the columns
    and appearance.


    The grid has sorting built into the columns by default. I would believe
    you could get access to triggering the type of sorting you need by column
    once the grid is populated. Look at the TableStyle assigned to the grid
    -- I think that ability may be tucked in there.

    I hope that helps.

    Keith

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center