Skip to main content

Moving Row Focus

  • 2 minutes to read

#Availability

Rows can be focused if the DataViewBase.NavigationStyle property isn't set to GridViewNavigationStyle.None. To specify a focused row, use the DataViewBase.FocusedRowHandle property. If a specified row isn't visible onscreen, a View is automatically scrolled to make the focused row visible.

#Moving Row Focus

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

Method Description
DataViewBase.MoveFirstRow Moves focus to the first visible row within a View.
DataViewBase.MovePrevPage Moves focus backward to the top row or card displayed onscreen within a View.
DataViewBase.MovePrevRow Moves focus to the row preceding the one currently focused.
DataViewBase.MoveNextRow Moves focus to the row following the one currently focused.
DataViewBase.MoveNextPage Moves focus forward to the bottom row or card displayed onscreen within a View.
DataViewBase.MoveLastRow Moves focus to the last visible row within a View.
DataViewBase.MoveFocusedRow Moves focus to the specified row.
GridViewBase.MoveParentGroupRow Moves focus to the group row that owns the currently focused row.

All these methods move focus between visible rows. These methods don't expand collapsed groups.

After the focused row has been changed, the DataViewBase.FocusedRowChanged event is raised.

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.

See Also