Moving Row Focus

Availability

Rows can be focused if the DataControlBase.NavigationStyle property is not set to GridControlNavigationStyle.None. To specify the focused row, use the DataControlBase.SelectedItemHandle property. If the specified row is not visible on the screen, the grid is automatically scrolled to make the focused row visible.

Moving Row Focus

The focused row is specified by its handle using the DataControlBase.SelectedItemHandle property. A grid provides multiple methods that you can use to move row focus. These methods are listed and described below:

Method Description
DataControlBase.MoveFirstRow Moves focus to the first visible row or card within the grid.
DataControlBase.MovePrevPage Moves focus backward by the number of rows or cards displayed onscreen within the grid.
DataControlBase.MovePrevRow Moves focus to the row or card preceding the one that is currently focused.
DataControlBase.MoveNextRow Moves focus to the row or card following the one that is currently focused.
DataControlBase.MoveNextPage Moves focus forward by the number of rows or cards displayed onscreen within the grid.
DataControlBase.MoveLastRow Moves focus to the last visible row or card within the grid.
DataControlBase.MoveSelectedItem Moves focus to the specified row.

All of these methods move focus between visible rows. These methods do not expand collapsed groups.

The DataControlBase.SelectedItemChanged event is raised after the focused row has been changed.

The number of visible rows is returned by the DataControlBase.VisibleRowCount property. Note that rows contained within collapsed group rows are not taken into account.