DxCheckBox<T>.FocusAsync() Method
In This Article
Moves focus to the CheckBox component.
Namespace: DevExpress.Blazor
Assembly: DevExpress.Blazor.v24.2.dll
NuGet Package: DevExpress.Blazor
#Declaration
C#
public ValueTask FocusAsync()
#Returns
Type | Description |
---|---|
Value |
A structure that stores an awaitable result of an asynchronous operation. |
#Remarks
Call this method to move focus to the input element of the CheckBox component as the following code snippet demonstrates. In this example focus moves to the element after the first render.
Razor
<DxCheckBox @ref="@component" Checked="true">Value</DxCheckBox>
@code {
DxCheckBox<bool> component;
protected override void OnAfterRender(bool firstRender)
{
base.OnAfterRender(firstRender);
component.FocusAsync();
}
}
See Also