Skip to main content

DxRichEdit.GotFocus Event

Fires after the Rich Text Editor receives focus.

Namespace: DevExpress.Blazor.RichEdit

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

NuGet Package: DevExpress.Blazor.RichEdit

Declaration

[Parameter]
public EventCallback GotFocus { get; set; }

Remarks

The following code snippet handles the GotFocus and LostFocus events:

<DxRichEdit @ref="richEdit" LostFocus="@onLostFocus" GotFocus="@onGotFocus" />
@code {
    DxRichEdit richEdit { get; set; }

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