Back to Devexpress

DxRichEdit.BarMode Property

blazor-devexpress-dot-blazor-dot-richedit-dot-dxrichedit-a2b734d4.md

latest2.1 KB
Original Source

DxRichEdit.BarMode Property

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

Declaration

csharp
[DefaultValue(BarMode.Ribbon)]
[Parameter]
public BarMode BarMode { get; set; }

Property Value

TypeDefaultDescription
BarModeRibbon

A bar mode. Requires the DevExpress.Blazor.Office namespace.

|

Available values:

NameDescription
Ribbon

The editor displays a ribbon.

| | Toolbar |

The editor displays a toolbar.

| | None |

The editor does not display a command bar.

|

Remarks

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:

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

UI Customization

DxRichEdit Class

DxRichEdit Members

DevExpress.Blazor.RichEdit Namespace