Back to Devexpress

IBarDropDown Interface

blazor-devexpress-dot-blazor-dot-office-2369369c.md

latest2.1 KB
Original Source

IBarDropDown Interface

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

Namespace : DevExpress.Blazor.Office

Assembly : DevExpress.Blazor.v25.2.dll

NuGet Package : DevExpress.Blazor

Declaration

csharp
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.

razor
<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";

    }    
}

Run Demo: Toolbar Customization

See Also

IBarDropDown Members

DevExpress.Blazor.Office Namespace