Chapter 24 Hierarchical Grid Architecture
On this page:
Introduction
The hierarchical grid architecture included in Objective Grid allows you to establish a one-to-many parent-child relationship between grids. This architecture enables you to expand/collapse each parent row so you can view/hide the row’s associated children in a tree-like fashion.
Example Hierarchy Grid
These grids derive from the
Hierarchical grid features:
- A grid parent and child can be instances of different types.
- Alternatively, if you specify a particular class type for the child, a new instance of that type is created for each child. You would typically populate such a child grid in the virtual mode, based on the corresponding parent row.
- You can explicitly bind a specific instance of a child grid to a parent row.
- Seamless current cell movement between the parent and the child.
- Automatic rearrangement of the children when the parent rows are moved.
- You can turn on a common child-grid header just below the parent header.
Note that the three grid types provide alternate APIs for certain common CGXGridCore APIs. For example, the Regular Grid type provides a SetLogRowCount/SetLogColCount. You should use this special API, rather than the standard SetRowCount/SetColCount, because the Regular grid implementation includes an expander column (with a plus-minus button) that adds to the logical columns in the underlying grid and also inserts one additional row for each logical row in the parent to host a child. The absolute rows/cols differ from logical rows/cols in each of the grid types. It is important to recall this distinction when you are calling the CGXGridCore functions directly.
Please refer to the sample located at <stingray-installdir>\Samples\Grid\ HierarchicalGrid.
Absolute Logical Coordinate Transformation
GetAbsCellFromLogCell()/ GetLogCellFromAbsCell()
Converts the logical cell coordinates to absolute cell coordinates, and the reverse.
GetAbsCellContainingChild()
Returns the absolute cell coordinates where a child grid is hosted.