BaseRow.HasChildren Property
Gets a value indicating whether a specific row contains child rows.
Namespace: DevExpress.XtraVerticalGrid.Rows
Assembly: DevExpress.XtraVerticalGrid.v24.2.dll
Declaration
Property Value
Type | Description |
---|---|
Boolean | true if a specific row contains one or more child rows; otherwise false. |
Remarks
Use this property to determine whether the current row has child rows. If the row’s BaseRow.ChildRows collection is not empty, the HasChildren property will return true.
Example
The following sample code expands all collapsed parent rows at the root level and collapses expanded ones. The BaseRow.Expanded property is used for this purpose. The collection of root level rows is accessed via the VGridControlBase.Rows property. The BaseRow.HasChildren
property is used to determine whether a row is a parent one and can be expanded or collapsed.
The image below displays the look & feel of a grid control before and after execution of the sample code.
foreach (BaseRow currRow in vGridControl1.Rows) {
// collapsing expanded parent rows or expanding collapsed ones
if (currRow.HasChildren) currRow.Expanded = !currRow.Expanded;
}