Skip to main content

TcxCustomGridTableController.FindNextItem(Integer,Boolean,Boolean,Boolean,Boolean,TcxCustomGridRecord) Method

Returns the index of the focusable data item that follows or precedes to the specified data item.

Declaration

function FindNextItem(AFocusedItemIndex: Integer; AGoForward: Boolean; AGoOnCycle: Boolean; AFollowVisualOrder: Boolean; out ACycleChanged: Boolean; ARecord: TcxCustomGridRecord): Integer; virtual;

Parameters

Name Type
AFocusedItemIndex Integer
AGoForward Boolean
AGoOnCycle Boolean
AFollowVisualOrder Boolean
ACycleChanged Boolean
ARecord TcxCustomGridRecord

Returns

Type
Integer

Remarks

A grid control allows you to prevent focusing a specific item by setting its Options.Focusing property to False. Such non-focusable items are skipped during keyboard navigation (using the arrow keys).

You can use the FindNextItem method to locate the first focusable item next to or prior to the item specified by the AFocusedItemIndex parameter. ARecord specifies the table record in which the search will be performed (can be nil for (Banded) Table Views, should represent a specific card for Card Views). The direction of the search is set by the AGoForward parameter. FindNextItem does not change focus but returns the index of the item found. If no item is found, -1 is returned.

AFollowVisualOrder specifies whether items are traversed according to the View’s layout. Set AFollowVisualOrder to True to search items in visual order (across from left to right and then down). False passed as this parameter is in effect only in Banded Table Views, where the search is performed in the same manner, but band-by-band.

If the AGoOnCycle parameter is False, a forward search will stop when reaching the last visible item and a backward search will stop when reaching the first visible View item.

If AGoOnCycle is True and AGoForward is True, the search for the focusable item will continue from the beginning when reaching the last visible item. For a backward search, it will continue from the last item when reaching the first one. On these actions the ACycleChanged parameter is set to True. Otherwise, it is set to False.

See Also