blazor-devexpress-dot-blazor-dot-richedit-dot-dxrichedit-a2b734d4.md
Specifies how the Rich Text Editor displays its command bar.
Namespace : DevExpress.Blazor.RichEdit
Assembly : DevExpress.Blazor.RichEdit.v25.2.dll
NuGet Package : DevExpress.Blazor.RichEdit
[DefaultValue(BarMode.Ribbon)]
[Parameter]
public BarMode BarMode { get; set; }
| Type | Default | Description |
|---|---|---|
| BarMode | Ribbon |
A bar mode. Requires the DevExpress.Blazor.Office namespace.
|
Available values:
| Name | Description |
|---|---|
| Ribbon |
The editor displays a ribbon.
| | Toolbar |
The editor displays a toolbar.
| | None |
The editor does not display a command bar.
|
The Rich Text Editor can display its command bar as a ribbon or toolbar. Use the BarMode property to hide the bar or change its display mode. To respond to bar mode changes, handle the BarModeChanged event.
The following code snippet hides the command bar, loads a document, and activates the read-only mode:
<DxRichEdit @ref="richEdit" ReadOnly="true" BarMode=BarMode.None/>
@code {
DxRichEdit richEdit;
protected override Task OnAfterRenderAsync(bool firstRender) {
if (firstRender)
InitializeDocument();
return base.OnAfterRenderAsync(firstRender);
}
async void InitializeDocument() {
await richEdit.LoadDocumentAsync("C:\\Users\\Public\\annual-report.docx");
}
}
See Also