Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

DxMemo.FocusAsync() Method

Moves focus to the Memo component.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

#Declaration

C#
public ValueTask FocusAsync()

#Returns

Type Description
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();
    }
}

Focused Element

See Also