QG_GetSelection(areaRef; selectedCell; cellSelection):errorCode
areaRef Longint QGrid area reference
selectedCell Longint Selected cell index
cellSelection Array longint Selected cell indices
error Longint Error result

Get the currently selected grid cells

Parameter areaRef is the QGrid area reference. If areaRef is not a valid QGrid area reference, qg_paramErr error is returned.

When the qg_SelectOneCell selection option is in effect, parameter selectedCell receives the index of the selected cell and is set to zero (0) if no cell is currently selected. Array parameter cellSelection is ignored and can be omitted.

If the qg_SelectManyCells selection option is in effect, array parameter cellSelection receives the indices of the user-selected cells while parameter selectedCell is set to zero. Array cellSelection is set to empty array if no cells are currently selected.


   // Get the selected cell in single-cell selection mode.


$err:=QG_GetSelection (xGrid;$selCell)
   // Get the selected cells in multi-cell selection mode.


ARRAY LONGINT($selectedCells;0)

$err:=QG_GetSelection (xGrid;0;$selectedCells)

Related commands

QG_SetSelection Specify which grid cell(s) to select
QG_SetSelectionOptions Set the user selection options for a QGrid area