Syncfusion AI Assistant

How can I help you?

Restrict editing in Blazor DocumentEditor Component

19 Jun 20261 minute to read

This Blazor Word Processor control (DocumentEditor) provides 2 types of restriction for editing:

  • Read-only: Allows all the users to view the document contents but not make changes to it.
  • Allows changes to certain portion of the document: Allows the users to edit to certain portion of the document.

Read only

The following code example shows how to restrict or protect editing for the entire content (show as read-only).

@using Syncfusion.Blazor.DocumentEditor

<button @onclick="ReadOnly">Read Only</button>
<SfDocumentEditorContainer @ref="container" EnableToolbar=true></SfDocumentEditorContainer>

@code {
    SfDocumentEditorContainer container;

    public void ReadOnly(object args)
    {
        container.RestrictEditing = true;
    }
}

Allows changes to certain portion of the document

Also, at some situations, you might need to allow changes for a certain portion of the document alone. Microsoft Word allows you to make changes to parts of a Word document. Likewise, the document editor control allows the users to make changes to certain parts of a document using similar user interface.

Disabling Restrict Editing in Blazor DocumentEditor

Enabling Restrict Editing in Blazor DocumentEditor

Online Demo

Explore how to restrict editing and protect Word documents using the Blazor Document Editor in this live demo here.