Back to Devexpress

NavBarGroup.Expanded Property

windowsforms-devexpress-dot-xtranavbar-dot-navbargroup-c1fa3ca2.md

latest2.9 KB
Original Source

NavBarGroup.Expanded Property

Gets or sets a value specifying whether the group is expanded.

Namespace : DevExpress.XtraNavBar

Assembly : DevExpress.XtraNavBar.v25.2.dll

NuGet Package : DevExpress.Win

Declaration

csharp
[DefaultValue(false)]
[XtraSerializableProperty]
public virtual bool Expanded { get; set; }
vb
<DefaultValue(False)>
<XtraSerializableProperty>
Public Overridable Property Expanded As Boolean

Property Value

TypeDefaultDescription
Booleanfalse

true if the group is expanded, otherwise false.

|

Remarks

Use the Expanded property to expand and collapse groups. You can also use the NavBarControl.ActiveGroup property to specify the expanded group.

Collapsing a group by setting the Expanded property to false is only in effect in SideBar Views. This scenario is not supported for Views where only the contents of a single group is visible (Navigation Pane and Side Bar Views). To collapse a group in these Views, you should expand another group instead.

Example

The following sample code toggles a group’s expansion state via the NavBarGroup.Expanded property. Individual groups are accessed via the NavBarControl.Groups property.

csharp
using DevExpress.XtraNavBar;
//...
for (int i = 0; i < navBarControl1.Groups.Count; i++) {
   NavBarGroup currGroup = navBarControl1.Groups[i];
   currGroup.Expanded = !currGroup.Expanded;
}
vb
Imports DevExpress.XtraNavBar
' ...
Dim I As Integer
For I = 0 To NavBarControl1.Groups.Count - 1
   Dim CurrGroup As NavBarGroup = NavBarControl1.Groups(I)
   CurrGroup.Expanded = Not CurrGroup.Expanded
Next

See Also

ActiveGroup

ExplorerBarShowGroupButtons

GroupCollapsed

GroupExpanded

NavBarGroup Class

NavBarGroup Members

DevExpress.XtraNavBar Namespace