Skip to main content
A newer version of this page is available. .

DxGrid.FocusedRowEnabled Property

Specifies whether the row focus is enabled.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v23.1.dll

NuGet Package: DevExpress.Blazor

Declaration

[DefaultValue(false)]
[Parameter]
public bool FocusedRowEnabled { get; set; }

Property Value

Type Default Description
Boolean false

true to enable the focused row; otherwise, false.

Remarks

Set the FocusedRowEnabled property to true to allow the Grid to focus data and group rows. Only one row can be focused at a time within the current page. When a page changes, the row loses focus.

<DxGrid @ref="Grid" FocusedRowEnabled="true" Data="@Products" PageSize="6" >
    <Columns>
        <DxGridDataColumn FieldName="ProductId" />
        <DxGridDataColumn FieldName="ProductName" />
        <DxGridDataColumn FieldName="UnitPrice" />
        <DxGridDataColumn FieldName="UnitsInStock" />
        <DxGridDataColumn FieldName="QuantityPerUnit" />
    </Columns>
</DxGrid>

Blazor Grid Focused Row

Focus can be moved in the following ways:

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

Run Demo: Grid - Focused Row View Example: How to display the Chart based on the Grid focus

Methods Designed to Work With the Focused Row

Data row

GetFocusedRowIndex() - Returns the visible index of the focused row or -1 if the Grid has no data to display.

SetFocusedRowIndex(Int32) - Moves focus to the row with the specified visible index.

IsRowFocused(Int32) - Identifies whether the row with the specified visible index is focused.

GetFocusedDataItem() - Returns the data item bound to the focused data row.

SetFocusedDataItemAsync(Object) - Moves focus to the row bound to the specified data item.

IsDataItemFocused(Object) - Returns whether the row bound to the specified data item is focused.

Group row

A group row has no bound data item, so you can work with a visible index only.

GetFocusedRowIndex() - Returns the visible index of the focused row or -1 if the Grid has no data to display.

SetFocusedRowIndex(Int32) - Moves focus to the row with the specified visible index.

IsRowFocused(Int32) - Identifies whether the row with the specified visible index is focused.

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

Implements

See Also