Back to Devexpress

DxGrid.SetFocusedDataItemAsync(Object) Method

blazor-devexpress-dot-blazor-dot-dxgrid-dot-setfocuseddataitemasync-x28-system-dot-object-x29.md

latest2.2 KB
Original Source

DxGrid.SetFocusedDataItemAsync(Object) Method

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

Namespace : DevExpress.Blazor

Assembly : DevExpress.Blazor.v25.2.dll

NuGet Package : DevExpress.Blazor

Declaration

csharp
public Task SetFocusedDataItemAsync(
    object dataItem
)

Parameters

NameTypeDescription
dataItemObject

The data item.

|

Returns

TypeDescription
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 additional information about row focus in the Grid component, refer to the following topic: Selection and Focus in Blazor Grid.

Implements

SetFocusedDataItemAsync(Object)

See Also

DxGrid Class

DxGrid Members

DevExpress.Blazor Namespace