Skip to main content

BarItemTypes Enum

Lists the bar item types.

Namespace: DevExpress.Blazor.Office

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

Declaration

public enum BarItemTypes

Members

Name Description
Button

A button.

CheckableButton

A checkable button.

ComboBox

A combo box editor.

SpinEdit

A spin editor.

ColorEdit

A color editor.

DropDown

A drop-down editor.

Related API Members

The following properties accept/return BarItemTypes values:

Remarks

The Rich Text Editor can display its command bar in two ways:

The BarItemTypes enumeration value specifies the bar item type.

<DxRichEdit @ref=@rich CustomizeRibbon=OnCustomizeRibbon @bind-ReadOnly="@readOnly"/>

@code {
    DxRichEdit rich;
    bool readOnly;

    void OnCustomizeRibbon(IRibbon ribbon) {
        IRibbonTab pageLayoutTab = ribbon.Tabs[RichEditRibbonTabNames.PageLayout];
        IBarGroup pageSetupGroup = pageLayoutTab.Groups[RichEditRibbonGroupNames.PageSetup];
        IBarItem paperSizeMenuItem = pageSetupGroup.Items[RichEditBarItemNames.PaperSizeMenu];
        if (paperSizeMenuItem.Type == BarItemTypes.DropDown) {
            IBarDropDown paperSizeDropDown = (IBarDropDown)paperSizeMenuItem;
            paperSizeDropDown.Items.Clear();
            paperSizeDropDown.Items.Add(RichEditBarItemNames.PaperSizeA4);
            paperSizeDropDown.Items.Add(RichEditBarItemNames.PaperSizeA5);
            paperSizeDropDown.Items.Add(RichEditBarItemNames.PaperSizeA6);
            paperSizeDropDown.GetEnabled = () => rich.ViewType == ViewType.PrintLayout;
            paperSizeDropDown.IconUrl = "your-item-icon-url";
        }
        paperSizeMenuItem.Text = "Paper Size";
        paperSizeMenuItem.Tooltip = "Choose a paper size.";
        paperSizeMenuItem.GetVisible = () => !readOnly;
    }
}
See Also