Skip to main content
All docs
V24.2

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

DxDropDownListEditorBase<TData, TValue>.FocusAsync() Method

Moves focus to the editor.

Namespace: DevExpress.Blazor.Base

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 editor component as the following code snippet demonstrates. In this example focus moves to the element after the first render.

Razor
<DxTagBox @ref="component" Data="@Cities" @bind-Values="@Values"></DxTagBox>

@code {
    DxTagBox<string, string> component;

    /* ... */

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

Focused Element

See Also