Skip to main content

RibbonTabCollection.AddCustomTab(String, String) Method

Adds a custom tab to the end of the ribbon.

Namespace: DevExpress.Blazor.Office

Assembly: DevExpress.Blazor.v24.1.dll

NuGet Package: DevExpress.Blazor

Declaration

public IRibbonTab AddCustomTab(
    string text,
    string categoryType = ""
)

Parameters

Name Type Description
text String

The tab text.

Optional Parameters

Name Type Default Description
categoryType String String.Empty

The category type.

Returns

Type Description
IRibbonTab

The inserted custom tab.

Remarks

Call an AddCustomTab method overload to create a custom tab and add it to the tab collection. You should add a group that contains items to the new tab to make it visible because the Rich Text Editor hides tabs that contain no visible and enabled items.

The following code snippet inserts custom tabs and populates them with default groups.

<DxRichEdit CustomizeRibbon=OnCustomizeRibbon />

@code {
    void OnCustomizeRibbon(IRibbon ribbon) {
        // Clears the tab collection
        ribbon.Tabs.Clear();
        // Inserts a custom tab at the end of the tab collection
        IRibbonTab tableTab = ribbon.Tabs.AddCustomTab("Table");
        tableTab.Groups.Add(RichEditRibbonGroupNames.LayoutRowsAndColumns);
        tableTab.Groups.Add(RichEditRibbonGroupNames.DesignBordersAndShadings);
        // Inserts a custom tab at the first position in the tab collection
        IRibbonTab fileTab = ribbon.Tabs.AddCustomTab(0, "File");
        IBarGroup fileGroup = fileTab.Groups.Add(RichEditRibbonGroupNames.FileCommon);
    }
}

Add Custom Tabs

Run Demo: Ribbon Customization

See Also