How to: Activate a Group

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.

int activeGroupIndex = navBarControl1.Groups.IndexOf(navBarControl1.ActiveGroup);
if (activeGroupIndex != 0) 
   navBarControl1.ActiveGroup = navBarControl1.Groups[0];