Skip to main content

BarItemCollectionBase<T>.Clear() Method

Removes all tabs, groups, or items from a tab, group, or item collection.

Namespace: DevExpress.Blazor.Office

Assembly: DevExpress.Blazor.v24.1.dll

NuGet Package: DevExpress.Blazor

Declaration

public void Clear()

Remarks

The following code snippet removes all groups from the ribbon’s Home tab.

<DxRichEdit CustomizeRibbon=OnCustomizeRibbon />

@code {
    void OnCustomizeRibbon(IRibbon ribbon) {
        IRibbonTab homeTab = ribbon.Tabs[RichEditRibbonTabNames.Home];
        // Removes all groups
        homeTab.Groups.Clear();
    }
}

The following code snippet removes all items from the Common group on the toolbar.

<DxRichEdit BarMode=BarMode.Toolbar CustomizeToolbar=OnCustomizeToolbar />

@code {
    void OnCustomizeToolbar(IToolbar toolbar) {
        IBarGroup fileCommonGroup = toolbar.Groups.Add(RichEditRibbonGroupNames.FileCommon);
        // Removes all items
        fileCommonGroup.Items.Clear();
    }
}
See Also