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

BarGroupCollection.Add(String) Method

Adds a predefined item group to the ribbon or toolbar.

Namespace: DevExpress.Blazor.Office

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

#Declaration

C#
public IBarGroup Add(
    string name
)

#Parameters

Name Type Description
name String

The name of the toolbar group or ribbon group to insert.

#Returns

Type Description
IBarGroup

The inserted item group.

#Remarks

The Add method overloads allow you to add a predefined group to a ribbon tab or toolbar. Use properties of the RichEditRibbonGroupNames and RichEditToolbarGroupNames classes to obtain names of all built-in ribbon and toolbar groups.

The following code snippet customizes the ribbon as follows:

Razor
<DxRichEdit CustomizeRibbon=OnCustomizeRibbon />

@code {
    void OnCustomizeRibbon(IRibbon ribbon) {
        BarGroupCollection groups = ribbon.Tabs[0].Groups;
        // Inserts the Undo/Clipboard group at the end of the group collection
        groups.Add(RichEditRibbonGroupNames.HomeUndoClipboard);
        // Inserts the Full Screen group at the first position in the group collection
        groups.Add(0, RichEditRibbonGroupNames.ViewFullScreen);
    }
}

Add Default Groups

Run Demo: Toolbar Customization Run Demo: Ribbon Customization

See Also