The DataGrid UI component can highlight the focused row. To enable this feature, set the focusedRowEnabled property to true.
To focus a row programmatically, specify the focusedRowKey property. In the UI, users can click a row to focus it. To focus a row in code, specify the focusedRowKey property. The UI component automatically scrolls to the focused row if the autoNavigateToFocusedRow property is enabled. The focused row is saved in the UI component's state.
In this demo, the row with the
117 key is focused initially. You can specify the
autoNavigateToFocusedRow properties via the input field and the checkbox below the UI component.