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

IBarDropDown Interface

A drop-down editor on the Rich Text Editor‘s ribbon or toolbar.

Namespace: DevExpress.Blazor.Office

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

#Declaration

C#
public interface IBarDropDown :
    IBarCheckableButton,
    IBarButton,
    IBarItemWithImageBase,
    IBarItem,
    IBarItemBase

The following members return IBarDropDown objects:

#Remarks

The following code snippet creates a custom drop-down editor that allows users to change a font style.

<DxRichEdit CustomizeToolbar=OnCustomizeToolbar BarMode=BarMode.Toolbar/>

@code {
    void OnCustomizeToolbar(IToolbar toolbar) {
        BarGroupCollection groups = toolbar.Groups;
        groups.Clear();
        AddFormattingGroup(groups);
        // ...
    }

    void AddFormattingGroup(BarGroupCollection groups) {
        IBarGroup formattingGroup = groups.AddCustomGroup();
        // ...

        // Adds a custom drop-down editor
        IBarDropDown fontDropDown = formattingGroup.Items.AddCustomDropDown(string.Empty);
        fontDropDown.Items.Add(RichEditBarItemNames.FontBold);
        fontDropDown.Items.Add(RichEditBarItemNames.FontItalic);
        fontDropDown.IconUrl = "_content/BlazorDemo/images/Font.svg";
        fontDropDown.Text = "Font";

    }    
}

Add a Custom Drop-Down Editor

Run Demo: Toolbar Customization

See Also