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

DxGrid.SetFocusedDataItemAsync(Object) Method

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

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

#Declaration

C#
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