TCustomGrid.TryMoveSelection function
Tries to move the cell selection by or to the specified column and row values.
Declaration
function TryMoveSelection(Relative: Boolean; var DCol: Integer;
var DRow: Integer): BooleanArguments
Relative | True the column and row numbers are relative offsets from the current cell. |
DCol | Column offset or number for the selection. |
DRow | Row offset or number for the selection. |
Function result
True on success.Description
TryMoveSelection is a
Boolean function used to select
the cell represented in the DCol and DRow arguments. These values can be
either an absolute cell address or relative offsets from the current cell in
Col and Row.
When Relative is True, the arguments can contain positive or negative values. Positive values move the selection to the right (for DCol) or towards the bottom of the grid (for DRow) starting at the cell in Col and Row. Negative values cause the selection to move in the opposite directions for each argument.
When Relative is False,the arguments in DCol and DRow are absolute cell coordinates and should contain only positive values.
TryMoveSelection calls SelectCell to select the cell at the specified column and row.
The return value is True if the specified cell was selected in the method. It is False if DCol or DRow do not represent a valid cell in the grid control. No actions are performed in the method when FixedGrid returns True, and the return value is set to False.
TryMoveSelection is called from the MoveExtend method and occurs before the OnBeforeSelection, OnSelection, and OnAfterSelection event handlers are signalled.
An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.
