Record Navigation
- 2 minutes to read
The GotoFirst, GotoLast, GotoNext and GotoPrev methods provided by a data controller allow you to navigate through visible rows in the order that they are displayed on screen. A row represents a potentially visible data record or a grouping row, which can be focused, selected and deleted. The order in which rows are displayed on screen is based on the sorting, filtering and grouping applied. Rows hidden within collapsed data groups cannot be accessed by these methods.
Navigation methods (GoToFirst, GoToLast, GoToNext and GoToPrev) provided by the View’s controller work in a similar manner. However, these also enable you to move focus between master and detail Views.
To move focus between rows, you can change the focused row or its index explicitly. See the Focused/Selected Records topic for more information.
Data record navigation is performed differently in provider/unbound and bound modes.
In provider, unbound, server, and default bound modes, you can use record indexes to iterate through data records. To make a data record focused and visible at the same time, you can assign its record index to the data controller’s FocusedRecordIndex property. Record indexes can vary from 0 to RecordCount - 1.
Note
Do not confuse the View’s Data
In grid mode, you should use methods provided by the TDataSet descendant associated with the data controller to navigate records.
ExpressQuantumGrid provides the end-user the ability to navigate records using an embedded View navigator control. This allows moving focus to the first, last, next and previous row and to the next and previous page.
To activate the navigator, set the View’s OptionsView.Navigator.Visible property to True.