Skip to main content

DxGrid.SetFocusedDataItemAsync(Object) Method

Moves focus to the row bound to the specified data item.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v23.2.dll

NuGet Package: DevExpress.Blazor

Declaration

public Task SetFocusedDataItemAsync(
    object dataItem
)

Parameters

Name Type Description
dataItem Object

The data item.

Returns

Type Description
Task

The task that is completed when the row bound to the specified data item is focused.

Remarks

When the FocusedRowEnabled property is set to true, the grid displays the focused row. Call the SetFocusedDataItemAsync method to focus a row bound to the specified data item and make the row visible on the screen. The Grid can expand group rows, change the current page index, and scroll data rows to make the focused row visible.

When the focused row changes, the grid raises the FocusedRowChanged event.

If you use the GridDevExtremeDataSource or Instant Feedback Data Source, you should specify the KeyFieldName or KeyFieldNames property value.

Run Demo: Grid - Focused Row

For more information about row focus in the Grid component, refer to the following topic: Selection and Focus in Blazor Grid.

See Also