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

BarManager.Categories Property

Gets a collection of categories used to logically organize bar items.

Namespace: DevExpress.XtraBars

Assembly: DevExpress.XtraBars.v24.2.dll

NuGet Package: DevExpress.Win.Navigation

#Declaration

[Browsable(false)]
public BarManagerCategoryCollection Categories { get; }

#Property Value

Type Description
BarManagerCategoryCollection

A BarManagerCategoryCollection object that represents the collection of categories.

#Remarks

Use this property to access a collection of categories created in the BarManager. Categories are used to logically organize items and this provides a convenient way to access items from the Customization Form. This property allows you to add, remove and get individual categories. Each category is represented by a BarManagerCategory object.

You can assign an item to a specific category by specifying the item’s BarItem.Category property.

For more information, see the How To: Organize Bar Items into Categories document.

#Example

The following sample code creates a new category and adds it to the BarManager’s BarManager.Categories collection. Then, the category created is assigned to the first item in the BarManager’s BarManager.Items collection.

if (barManager1.Categories.IndexOf("NewCategory") == -1) {
   barManager1.Items[0].Category = barManager1.Categories.Add("NewCategory");
}
See Also