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);
' 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);
}
Imports DevExpress.XtraBars.Ribbon
Private Sub ClearRibbonGroup(ByVal ribbonGroup As RibbonPageGroup, ByVal ribbon As RibbonControl)
Dim count = ribbonGroup.ItemLinks.Count
For i As Integer = 0 To count - 1
ribbon.Items.Remove(ribbonGroup.ItemLinks.First().Item)
Next i
End Sub