Back to Devexpress

BarItemCollectionBase<T>.Clear() Method

blazor-devexpress-dot-blazor-dot-office-dot-baritemcollectionbase-1-ae8d1ecd.md

latest1.4 KB
Original Source

BarItemCollectionBase<T>.Clear() Method

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

Namespace : DevExpress.Blazor.Office

Assembly : DevExpress.Blazor.v25.2.dll

NuGet Package : DevExpress.Blazor

Declaration

csharp
public void Clear()

Remarks

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

razor
<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.

razor
<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

BarItemCollectionBase<T> Class

BarItemCollectionBase<T> Members

DevExpress.Blazor.Office Namespace