Skip to main content

NavGroupCollection.Item[Int32] Property

Gets an item of the collection by its index.

Namespace: DevExpress.XtraNavBar

Assembly: DevExpress.XtraNavBar.v24.1.dll

NuGet Packages: DevExpress.Win, DevExpress.Win.Navigation

Declaration

public virtual NavBarGroup this[int index] { get; }

Parameters

Name Type Description
index Int32

An integer value specifying the zero-based index of the desired group.

Property Value

Type Description
NavBarGroup

A NavBarGroup object representing the group located at the specified index within the collection.

Remarks

If the parameter value is negative or exceeds the maximum available index, an exception is raised.

Example

The following sample code demonstrates how to iterate through groups and item links. The group collection is accessed via the NavBarControl.Groups property. Links are accessed via the group’s NavBarGroup.ItemLinks property.

using DevExpress.XtraNavBar;
//...
for (int i = 0; i < navBarControl1.Groups.Count; i++) {
   NavBarGroup currGroup = navBarControl1.Groups[i];
   // perform some operations on a group here
   //...
   for (int j = 0; j < currGroup.ItemLinks.Count; j++) {
      NavBarItemLink currLink = currGroup.ItemLinks[j];
      // perform some operations on a link here
      //...
   }
}
See Also