Skip to main content
All docs
V24.2

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: Remove Bar Items

To remove a bar item, remove it from the RibbonControl.Items collection. This also removes all bar item links.

// Removes the bar item and all its links.
ribbon.Items.Remove(barButtonItem1);

The following example shows how to remove all bar items from a Ribbon Page Group.

using DevExpress.XtraBars.Ribbon;

void ClearRibbonGroup(RibbonPageGroup ribbonGroup, RibbonControl ribbon) {
    var count = ribbonGroup.ItemLinks.Count;
    for(int i = 0; i < count; i++)
        ribbon.Items.Remove(ribbonGroup.ItemLinks.First().Item);
}