RowExpandedproperty
Specify whether the current row is expanded or collapsed. The current row is defined by the Col and Row properties.
Syntax
PROPERTY RowExpanded () AS BOOLEAN
PROPERTY RowExpanded (BYVAL bRowExpanded AS BOOLEAN)
Parameters
| Name | Description | |
|---|---|---|
bRowExpanded | Assigning True expands the current row. Assigning False collapses the current row. |
Return value
True: The current row is expanded and its child rows are visible.
False: The current row is collapsed and its child rows are hidden.
Description
Indicates or sets whether the current row is expanded. The current row is defined by the Col and Row properties.
Remarks
This property only has an effect when the MSHFlexGrid is displaying hierarchical data, typically from a SHAPE recordset created with the MSDataShape provider.
When a row is expandable, the grid automatically displays "+" or "-" icons. Setting RowExpanded to True or False programmatically is the equivalent of a user clicking these icons.
For a row to be expandable, the BandExpandable property for its specific level must be set to True
Examples
' Expand the current row grid.RowExpanded = TRUE
' Collapse the current row grid.RowExpanded = FALSE
' Check expansion state If grid.RowExpanded Then
Print "Row is expanded"
End If
' Loop through all rows to expand them grid.Redraw = False ' Prevent flickering For i As Long = 0 To grid.Rows - 1 ' Attempt to expand the row; non-expandable rows will simply be ignored grid.RowExpanded(i) = True Next grid.Redraw = True
Reference
- Documented in Windows/Windows GUI/MSHFlexGrid Class.md
- Topic: Microsoft Hierarchical Grid