Fog Creek Software
Discussion Board




Welcome! and rules

Joel on Software

Displaying Hierarchical Data

I am building an ASP.NET application with a requirement to display data in a hierarchical manner.  I am retrieveing data from a database and placing that data into custom collection classes. Each object in the collection has a collection property that can in turn hold objects of the same type, thus the hierarchical nature of the data. 

When I try to display the data hierarchically, however, I run into trouble. I need to create a collapsible/expandable list, similar to a treeview control, but with the data displayed in a tabular format, similar to datagrid or repeater. 

At this point I have hardcoded nested repeaters in my .aspx page, but this caps the  depth that I am able to display (ie. If my Collection Classes have a depth exeecinf what I have hardcoded, objects beyond that depth won't be displayed).

Has anyone had any luck with somethign like this so far?

Hash550
Tuesday, March 29, 2005

Do you have to do it declaratively? Why not make your own control to iterate/recurse over the collections programmatically and spit out HTML or create child controls etc?

Thom Lawrence
Wednesday, March 30, 2005

I feel sure that I saw a control on http://asp.net/Default.aspx?tabindex=2&tabid=31 that did this.

Colm O'Connor
Thursday, March 31, 2005

I use Infragistics' UltraWebGrid, I do hierarchial displays all the time with it, wouldn't do it any other way.

SongSing Writer
Friday, April 01, 2005

i second the infragistics control - we use the same grid to display hierarchal data.  not sure how deep it can handle.

bw
Friday, April 01, 2005

*  Recent Topics

*  Fog Creek Home