Skip to main content
Bar

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

BarManagerCategory.GetItemCount() Method

Gets the number of items displayed in the category.

Namespace: DevExpress.XtraBars

Assembly: DevExpress.XtraBars.v24.2.dll

NuGet Package: DevExpress.Win.Navigation

#Declaration

public int GetItemCount()

#Returns

Type Description
Int32

An integer value equal to the number of items displayed in the category.

#Remarks

Use this method to determine the number of items displayed in the category. This can be useful when you need to traverse through the items. In this case, read the GetItemCount method’s return value to obtain the number of iterations required.

If it is necessary to get an item displayed in the category at a specified position, use the BarManagerCategory.GetItem method.

#Example

The following sample code removes all links to the items displayed in the “Custom” category.

if (barManager1.Categories.IndexOf("Custom") != -1)
   for (int i = 0; i < barManager1.Categories["Custom"].GetItemCount(); i++)
      barManager1.Categories["Custom"].GetItem(i).Links.Clear();
See Also