Objective Grid for Microsoft® .NET® Reference Guide

GridControl.HierarchicalGrid Property

Back to Class Index

Gets or Sets Hierarchical Grid Mode.     

[Visual Basic]
Public Property HierarchicalGrid As Boolean
[C#]
public bool HierarchicalGrid {get; set;}

Remarks

    

The grid supports the display of hierarchical relationships. Hierarchical display is controlled by the HierarchicalGrid property. By default, the property is set to false, and the grid does not support hierarchical relationship display. If the HierarchicalGrid property is set to true, the grid enters hierarchical grid mode and allows for the display of child rows within each normal row.     

    

When in hierarchical grid mode, the grid's API and your use of it is uneffected. Rows and columns are numbered as they are in non-hierarchical mode, and all general purpose functions perform the same. While the programming interface to the grid is unaltered by hierarchical mode, the look of the grid is changed somewhat. When the grid enters hierarchy display mode, an new "Expander control" is automatically added to row headers. The "Expander control" shows the standard plus-minus box which when pressed toggles the visibility of child rows for the given row.     

    

When an expander is hit, the grid creates a child grid and positions it below the parent row. The child grid creation and initialization process is virtualized so that your derived classes can customize child grids. Once expanded, a child grid can be retrieved from the parent grid and its API used directly.     

    

Hierarchical grid mode can be changed at design time or at runtime. Note, when the hierarchical grid mode is changed, all rows and columns are deleted from the grid. After changing the mode, you must add rows and columns back to the grid programmatically. See the EnableHierarchicalGrid function for a method of automatically reinitializing the grid after a mode change.     

    

ADVANCED TOPICS - Logical and Physical cell coordingates: In hierarchical grid mode, row and column coordinates are numbered identically to non-hierarchical grid. But internally, hierarchical grid uses a different coordinate mapping than non-hierarchical grid. For ease of use, GridControl unifies the coordinates systems into one so that hierarchical and non-hierarchical applications can be programmed in the same way. This simplifies the common case, but you may find occasions where the automatic mapping of Row and Column coordinates is undesirable. For details on how to override this behavior see the 'hgArgs' property.     

    

See Also

GridControl Class | GridControl Members | Stingray.Grid Namespace