Skip to main content

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

Returns the visible index of the focusable data item that follows or precedes 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 Description
AFocusedItemIndex Integer

Specifies the visible index of the focusable data item used as the start position of the current search operation.

The function searches the next or previous focusable data item depending on the AGoForward parameter value.

AGoForward Boolean

Specifies the search direction:

True
The function searches the nearest focusable data item whose visible index exceeds AFocusedItemIndex.
False
The function searches the nearest focusable data item whose visible index is less than AFocusedItemIndex.
AGoOnCycle Boolean
True
The function restarts the current search operation from the first visible data item once the last visible data item is reached. The AGoForward parameter value specifies the search direction.
False
The function finishes the current search operation at the last (AGoForward is True) or first (AGoForward is False) visible data item.
AFollowVisualOrder Boolean

Specifies if the function iterates through data items according to their positions in the grid View layout:

True
The function iterates through data items according to their visual order (from left to right, from top to bottom, or vice versa, depending on the AGoForward parameter value).
False
Affects only Banded Table Views. The function iterates through data items band by band (that is, skips all data items that belong to the processed band).
ACycleChanged Boolean

Identifies if the function wrapped the current search operation when the AGoOnCycle parameter accepts True:

False
The function found the target data item before the first or last visible data item is reached.
True
The function restarted the search operation from the first (AGoForward is True) or last (AGoForward is False) visible data item.
ARecord TcxCustomGridRecord

Specifies the target record.

Note

You can pass nil (in Delphi) or nullptr (in C++Builder) for a Table or Banded Table grid View.

Returns

Type Description
Integer

The visible index of the found focusable data item.

The function returns -1 if no data item meets the specified search criteria.

Remarks

You can set an individual data item’s Options.Focusing property to False to prevent users from moving focus to the data item. Such items cannot accept focus, and all keyboard navigation operations skip these items.

Call the FindNextItem function to identify the focusable data item nearest to the required position (visible data item index) passed as the AFocusedItemIndex parameter.

Note

The FindNextItem function only returns the visible index of the next or previous focusable data item. The current focus position remains unchanged.

See Also