Skip to main content

TcxCustomGridTableController.FindNextRecord(Integer,Boolean,Boolean,Boolean) Method

Returns the position of the next or previous record.

Declaration

function FindNextRecord(AFocusedRecordIndex: Integer; AGoForward: Boolean; AGoOnCycle: Boolean; out ACycleChanged: Boolean): Integer;

Parameters

Name Type
AFocusedRecordIndex Integer
AGoForward Boolean
AGoOnCycle Boolean
ACycleChanged Boolean

Returns

Type
Integer

Remarks

You can use the FindNextRecord method to get the index (visual position) of a record next to or prior to the record addressed by the AFocusedRecordIndex parameter. This method is also used internally when a user navigates records using the keyboard Arrow keys. To focus the next/previous record, see the FocusNextRecord method.

The direction of the search is defined by the AGoForward parameter. If it is set to False, FindNextRecord locates the previous record. If AGoForward is True, the index of the next record is returned.

FindNextRecord will cycle once it reaches the last record if you set the AGoOnCycle parameter to True. In a forward search, the navigation will be continued from the first record when it reaches the last record. Similarly, when searching backward, the FindNextRecord function returns the index of the last record if AFocusedRecordIndex addresses the first record. By default the ACycleChanged argument is set to True. Otherwise, it is set to False.

See Also