Back to Devexpress

DxMemo.FocusAsync() Method

blazor-devexpress-dot-blazor-dot-dxmemo-8b0326c5.md

latest1.2 KB
Original Source

DxMemo.FocusAsync() Method

Moves focus to the Memo component.

Namespace : DevExpress.Blazor

Assembly : DevExpress.Blazor.v25.2.dll

NuGet Package : DevExpress.Blazor

Declaration

csharp
public ValueTask FocusAsync()

Returns

TypeDescription
ValueTask

A structure that stores an awaitable result of an asynchronous operation.

|

Remarks

Call this method to move focus to the input element of the Memo component as the following code snippet demonstrates. In this example focus moves to the element after the first render.

razor
<DxMemo @ref="component" Text="This is Memo. It is a multiline text editor."></DxMemo>

@code {
    DxMemo component;

    protected override void OnAfterRender(bool firstRender)
    {
        base.OnAfterRender(firstRender);
        component.FocusAsync();
    }
}

See Also

DxMemo Class

DxMemo Members

DevExpress.Blazor Namespace