BarManagerCategory.GetItemCount() Method
Gets the number of items displayed in the category.
Namespace: DevExpress.XtraBars
Assembly: DevExpress.XtraBars.v24.1.dll
NuGet Package: DevExpress.Win.Navigation
Declaration
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();