Skip to main content

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

BarItemCollectionBase<T>.Clear() Method

In This Article

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

Namespace: DevExpress.Blazor.Office

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

#Declaration

C#
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