BandExpandableproperty
Returns and sets a value that determines whether the row in the current band can be expanded and collapsed. The current band is defined by the Col and Row properties.
Syntax
PROPERTY BandExpandable (BYVAL BandNumber AS LONG) AS BOOLEAN
PROPERTY BandExpandable (BYVAL BandNumber AS LONG, BYVAL bExpandable AS BOOLEAN)
Parameters
| Name | Description | |
|---|---|---|
BandNumber | A Long representing the zero-based index of the specific hierarchical band (0 for the parent level, 1 for the first child level, etc.). | |
bExpandable | True (Default) enables the expansion/collapse feature for the band; False prevents the user from changing its visibility state. |
Description
Returns and sets a value that determines whether the row in the current band can be expanded and collapsed. The current band is defined by the Col and Row properties.
Remarks
This property is an array-based setting indexed by the band number. It allows you to control the "drill-down" capability for each level of nested data independently.
When set to True, the grid displays "+" and "-" icons next to parent records, allowing users to drill down into one-to-many relationships.
This property is only functional when the grid is bound to a hierarchical data source, such as a Shaped Recordset created via the MSDataShape provider.
If set to False, the specified band remains in its current state (either fully expanded or fully collapsed) and the user cannot toggle it.
Example
' Prevents the parent band (Band 0) from being collapsed grid.BandExpandable(0) = False
' Allows the first child level (Band 1) to be expanded/collapsed grid.BandExpandable(1) = True
Reference
- Documented in Windows/Windows GUI/MSHFlexGrid Class.md
- Topic: Microsoft Hierarchical Grid