Skip to main content

DxRichEdit.SelectionChanged Event

Fires after the selection is changed.

Namespace: DevExpress.Blazor.RichEdit

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

NuGet Package: DevExpress.Blazor.RichEdit

Declaration

[Parameter]
public EventCallback<Selection> SelectionChanged { get; set; }

Parameters

Type Description
Selection

A new value of the Selection property.

Remarks

Handle the SelectionChanged event to react to selection changes.

<DxRichEdit Selection="@richSelection" SelectionChanged="OnSelectionChanged" />

@code {
    Selection richSelection { get; set; }

    async Task OnSelectionChanged(Selection newSelection) {
    /* 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 {
            richSelection = newSelection;
            // Your code
        }
        catch (OperationCanceledException e) {
            Console.WriteLine($"{nameof(OperationCanceledException)} thrown with message: {e.Message}");
        }
    }
}
See Also