Back to Devexpress

RibbonTabCollection.Add(Int32, String) Method

blazor-devexpress-dot-blazor-dot-office-dot-ribbontabcollection-dot-add-x28-system-dot-int32-system-dot-string-x29.md

latest2.1 KB
Original Source

RibbonTabCollection.Add(Int32, String) Method

Adds a predefined tab to the end of the ribbon.

Namespace : DevExpress.Blazor.Office

Assembly : DevExpress.Blazor.v25.2.dll

NuGet Package : DevExpress.Blazor

Declaration

csharp
public IRibbonTab Add(
    int index,
    string name
)

Parameters

NameTypeDescription
indexInt32

The position where to insert the tab.

| | name | String |

The tab name.

|

Returns

TypeDescription
IRibbonTab

The inserted ribbon tab.

|

Remarks

The following code snippet customizes the ribbon as follows:

  • Clears the tab collection.
  • Adds the default File and Home tabs to the collection.
razor
<DxRichEdit CustomizeRibbon=OnCustomizeRibbon />

@code {
    void OnCustomizeRibbon(IRibbon ribbon) {
        ribbon.Tabs.Clear();
        // Inserts the Home tab at the end of the tab collection
        ribbon.Tabs.Add(RichEditRibbonTabNames.Home);
        // Inserts the File tab at the first position in the tab collection
        ribbon.Tabs.Add(0, RichEditRibbonTabNames.File);
    }
}

Run Demo: Ribbon Customization

See Also

RibbonTabCollection Class

RibbonTabCollection Members

DevExpress.Blazor.Office Namespace