BaseRow.Expanded Property

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

Namespace: DevExpress.XtraVerticalGrid.Rows

Assembly: DevExpress.XtraVerticalGrid.v20.1.dll

Declaration

[DXCategory("Appearance")]
[DefaultValue(true)]
[XtraSerializableProperty]
public virtual bool Expanded { get; set; }
<DXCategory("Appearance")>
<DefaultValue(True)>
<XtraSerializableProperty>
Public Overridable Property Expanded As Boolean

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.

Examples

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