Back to Devexpress

How to: Activate a Group

windowsforms-4901-controls-and-libraries-navigation-controls-navigation-bar-examples-layout-how-to-activate-a-group.md

latest773 B
Original Source

How to: Activate a Group

  • Nov 13, 2018

The following sample code obtains the index of the active group. If the active group is not the first within the collection, the first group becomes active.

Note : this example only works for those control paint styles which allow only a single expanded group at a time.

csharp
int activeGroupIndex = navBarControl1.Groups.IndexOf(navBarControl1.ActiveGroup);
if (activeGroupIndex != 0) 
   navBarControl1.ActiveGroup = navBarControl1.Groups[0];
vb
Dim ActiveGroupIndex = NavBarControl1.Groups.IndexOf(NavBarControl1.ActiveGroup)
If ActiveGroupIndex <> 0 Then
   NavBarControl1.ActiveGroup = NavBarControl1.Groups(0)
End If