blazor-devexpress-dot-blazor-dot-office-b4230ef1.md
Lists the bar item types.
Namespace : DevExpress.Blazor.Office
Assembly : DevExpress.Blazor.v25.2.dll
NuGet Package : DevExpress.Blazor
public enum BarItemTypes
| 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.
|
The following properties accept/return BarItemTypes values:
The Rich Text Editor can display its command bar in two ways:
Ribbon UI. The ribbon consists of multiple tabs. A tab includes groups, and a group can contain various items.
Toolbar UI. The toolbar consists of groups, and each group contains one or more items.
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