TcxGridBandedTableController.FindNextColumnVertically(Integer,Boolean,Boolean) Method
Returns the index of the upper/lower focusable column in the in the current data row.
Declaration
function FindNextColumnVertically(AFocusedItemIndex: Integer; AGoForward: Boolean; AGoOnCycle: Boolean): Integer; virtual;
Parameters
Name | Type |
---|---|
AFocusedItemIndex | Integer |
AGoForward | Boolean |
AGoOnCycle | Boolean |
Returns
Type |
---|
Integer |
Remarks
A Banded Table View enables you to arrange columns in several lines by setting their Position.RowIndex properties. When a user focuses a column in the top line of the current record and presses the Down arrow key, the focus is moved to a relative column in a lower line of the same record. Pressing the Up arrow key in the last line focuses a relative column in an upper line.
The FindNextColumnVertically function is used in such cases to locate a column in the upper or lower line(s) relative to the AFocusedItemIndex column. The direction of the search is defined by the AGoForward property. If AGoForward is set to True, a column in a lower line is located. Otherwise, it returns the index of an upper column.
The position of a column within a line is specified by its Position.ColIndex property. The FindNextColumnVertically function locates a focusable column with Position.ColIndex set to the same value as the Position.ColIndex property of the AFocusedItemIndex column. If such a column is not found in the following/preceding line(s), the function returns -1.
When the function returns -1, this indicates that the focus should be moved to another record.
The AGoOnCycle parameter specifies whether the search will cycle to the beginning once it has reached the end of the data. If AGoOnCycle is False, a forward search will stop when reaching the last line and a backward search will stop when reaching the first line.
If AGoOnCycle is True and AGoForward is True, the search of the focusable column will continue from the beginning when reaching the last line. For a backward search, it will continue from the last line when reaching the first one.