Skip to main content
All docs
V21.2

SubDocument.GetTextSpanAsync(Int32, Int32) Method

Gets the text span at the specified position.

Namespace: DevExpress.Blazor.RichEdit

Assembly: DevExpress.Blazor.RichEdit.v21.2.dll

NuGet Package: DevExpress.Blazor.RichEdit

Declaration

public ValueTask<TextSpan> GetTextSpanAsync(
    int startPosition,
    int length
)

Parameters

Name Type Description
startPosition Int32

A start position of the span.

length Int32

A length of the span.

Returns

Type Description
ValueTask<TextSpan>

A structure that stores an awaitable result of an asynchronous operation. The awaitable result is the text span.

Remarks

Call the ChangePropertiesAsync(Action<CharacterProperties>) method to change properties of the text span’s characters.

<DxRichEdit @ref="richEdit" CssClass="w-100 ch-720" />

@code {
    DxRichEdit richEdit;
    @* ... *@
        Document documentAPI = richEdit.DocumentAPI;
        @* ... *@
        TextSpan boldTextSpan = await documentAPI.GetTextSpanAsync(0, 15);
        await boldTextSpan.ChangePropertiesAsync(properties => {
            properties.FontBold = true;
        });
        @* ... *@
}
See Also