Skip to main content

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

Focuses the cell next to or prior to the specified one.

Declaration

function FocusNextItem(AFocusedItemIndex: Integer; AGoForward: Boolean; AGoOnCycle: Boolean; AGoToNextRecordOnCycle: Boolean; AFollowVisualOrder: Boolean; ANeedNormalizeSelection: Boolean = False): Boolean; virtual;

Parameters

Name Type
AFocusedItemIndex Integer
AGoForward Boolean
AGoOnCycle Boolean
AGoToNextRecordOnCycle Boolean
AFollowVisualOrder Boolean
ANeedNormalizeSelection Boolean

Returns

Type
Boolean

Remarks

You can use the FocusNextItem method to navigate cells (items) within the current View.

FocusNextItem moves focus to an item next to or prior to the one specified by the AFocusedItemIndex parameter. If an item cannot be focused (its Options.Focusing property is set to False), it is skipped by the method. The direction of the search is determined by the AGoForward parameter.

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.

The FocusNextItem method will cycle once it reaches the last item If the AGoOnCycle parameter is True. If AGoOnCycle is True and AGoForward is True, the search of the focusable item will continue from the first item when reaching the last visible item. In a backward search, it will continue from the last item when reaching the first one. On such actions, the focus remains in the current record if AGoToNextRecordOnCycle is set to False and moves to an adjacent record if AGoToNextRecordOnCycle is set to True.

The function of the AGoToNextRecordOnCycle parameter is equivalent to that of the View’s OptionsBehavior.FocusCellOnCycle property.

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.

The FocusNextItem function returns True if the focusable cell was found. Otherwise, False is returned.

See Also