Skip to main content
All docs
V24.1

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