Skip to main content

How to: Expand and Collapse Groups

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

Groups - Expanded

using DevExpress.XtraNavBar;
//...
for (int i = 0; i < navBarControl1.Groups.Count; i++) {
   NavBarGroup currGroup = navBarControl1.Groups[i];
   currGroup.Expanded = !currGroup.Expanded;
}