Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
195
Displaying hierarchal data from a flat source
posted

I am just starting out with your controls here. I want to display some hierarchal data. The data source is a flat view that looks something like:

ID COL_1 COL_2 COL_3
~~ ~~~~~ ~~~~~ ~~~~~
1     X           Y           A 
1     X           Y           B
2     M          N           J 
2     M          N           K

I want the grid to be expandable using (+ / -). When collapsed I would like it to show the ID and columns COL_1 and COL_2 as a single row (they will always have the same values for the same ID and can be thought of as the parent). When expanded I’d like to see the COL_3 values as children.
How can I set up the grid to do this?

  • 469350
    Offline posted

    If you want the grid to show data in a hierarchy like this, then you would need to set up your data source to be hierarchical. So you would have to set up your data so that you have two tables with a relationship, or maybe populate an UltraDataSource with parent and child rows. Basically the root-level rows would have to expose lists of child rows.