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 |
---|---|
Data |
Moves focus to the first visible row within a View. |
Data |
Moves focus backward to the top row or card displayed onscreen within a View. |
Data |
Moves focus to the row preceding the one currently focused. |
Data |
Moves focus to the row following the one currently focused. |
Data |
Moves focus forward to the bottom row or card displayed onscreen within a View. |
Data |
Moves focus to the last visible row within a View. |
Data |
Moves focus to the specified row. |
Grid |
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.