blazor-devexpress-dot-blazor-dot-richedit-dot-dxrichedit-9d88c8dd.md
Fires after the selection is changed.
Namespace : DevExpress.Blazor.RichEdit
Assembly : DevExpress.Blazor.RichEdit.v25.2.dll
NuGet Package : DevExpress.Blazor.RichEdit
[Parameter]
public EventCallback<Selection> SelectionChanged { get; set; }
| Type | Description |
|---|---|
| Selection |
A new value of the Selection property.
|
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