Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

BaseRow.HasChildren Property

Gets a value indicating whether a specific row contains child rows.

Namespace: DevExpress.XtraVerticalGrid.Rows

Assembly: DevExpress.XtraVerticalGrid.v24.2.dll

NuGet Packages: DevExpress.Win.Navigation, DevExpress.Win.VerticalGrid

#Declaration

[Browsable(false)]
public virtual bool HasChildren { get; }

#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.

BaseRow_Expanded

foreach (BaseRow currRow in vGridControl1.Rows) {
    // collapsing expanded parent rows or expanding collapsed ones
    if (currRow.HasChildren) currRow.Expanded = !currRow.Expanded;
}
See Also