QG_SetSelection

QG_SetSelection(areaRef; targetCell; cellSelection):errorCode
areaRef Longint QGrid area reference
targetCell Longint Single cell index to select
cellSelection Array longint Multiple cell indexes to select
error Longint Error result

Applies a user selection to the QGrid area. Any previous user selection will be replaced by the newly set one.

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 targetCell should hold the index of the cell to be selected. In this case parameter cellSelection is ignored and can be omitted.

If the qg_SelectManyCells selection option is in effect, parameter cellSelection holds the array of cell indexes to be selected. If parameter cellSelection is not present, then the user selection is set to the single cell indicated in the targetCell parameter.

Note

To clear the current user selection call QG_SetSelection with parameter targetCell set to 0 and omit parameter cellSelection.

Example

`---------------------------------------------------------------------
` (1) Select the first 3 cells in area xGrid
` (requires selection option qg_SelectManyCells to be in effect)
 
C_LONGINT($err)
ARRAY LONGINT($cells;3)
 
$cells{1}:=1
$cells{2}:=2
$cells{3}:=3
 
$err:=QG_SetSelection (xGrid;0;$cells)
If ($err # qg_noErr)
  ` Handle the error
End if
 
 
`---------------------------------------------------------------------
` (2) Clear the user selection
 
C_LONGINT($err)
 
 
$err:=QG_SetSelection (xGrid;0)
If ($err # qg_noErr)
  ` Handle the error
End if
 

Related commands

QG_GetSelection Get the current user selection of grid cells
QG_SetSelectionOptions Sets the user selection options for a QGrid area

QGrid © Escape
Generated by QDoc 2.8 on Thu, Oct 8, 2009 17:35:38