Skip to main content

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

How to: Add an item to a category

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");
}