Skip to main content

CharacterProperties.Hidden Property

Specifies whether content is hidden.

Namespace: DevExpress.Blazor.RichEdit

Assembly: DevExpress.Blazor.RichEdit.v24.1.dll

NuGet Package: DevExpress.Blazor.RichEdit

Declaration

public bool? Hidden { get; set; }

Property Value

Type Description
Nullable<Boolean>

true if content is hidden; false if content is visible; null if only some content is hidden.

Remarks

The Hidden property defines whether content is hidden. Select the HomeShow/Hide ¶ ribbon command to show/hide hidden content. The Rich Text Editor underlines hidden content with the dotted line.

Rich Edit - Hidden Characters

Use a text span’s Hidden or a table cell’s CharacterProperties.Hidden property to identify whether content in the span or cell is hidden. Call the TextSpan.ChangePropertiesAsync or TableCell.ChangePropertiesAsync method to show or hide content.

The following example hides a text span’s content:

<DxRichEdit @ref="richEdit" />

@code {
    DxRichEdit richEdit;
    Document documentAPI;

    protected override async Task OnAfterRenderAsync(bool firstRender) {
        if (firstRender)
            try {
                await InitializeDocument();
            }
            catch (TaskCanceledException) { }
        await base.OnAfterRenderAsync(firstRender);
    }

    async Task InitializeDocument() {
    /* Surround the code that contains an asynchronous operation with a try-catch block to handle
    the OperationCanceledException. This exception is thrown when an asynchronous operation is canceled. */
        try {
            documentAPI = richEdit.DocumentAPI;
            TextSpan characters = await documentAPI.AddTextAsync("New Text");
            await characters.ChangePropertiesAsync(properties => {
                properties.Hidden = true;
            });
        }
        catch (OperationCanceledException e) {
            Console.WriteLine($"{nameof(OperationCanceledException)} thrown with message: {e.Message}");
        }
    }
}

Implements

See Also