Skip to main content

BaseRow.Expanded Property

Gets or sets a value specifying whether the current row is expanded.

Namespace: DevExpress.XtraVerticalGrid.Rows

Assembly: DevExpress.XtraVerticalGrid.v23.2.dll

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

Declaration

[DefaultValue(true)]
[DXCategory("Appearance")]
[XtraSerializableProperty]
public virtual bool Expanded { get; set; }

Property Value

Type Default Description
Boolean true

true if the current row is expanded; otherwise false.

Remarks

The Expanded property is only for parent rows (i.e. for rows containing child rows). You can determine whether a particular row has children by using the BaseRow.HasChildren property. Set a parent’s row Expanded property to true to display its child rows. If set to false, the current parent row is collapsed and its child rows hidden.

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;
}

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the Expanded property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also