Control Object Properties
Multiple Selections Grid, List Box, Listview, Treeview
   
Description The following properties are used to process multiple selections in lists and grids:

'SelectCount Number of items/cells selected. (Set this property to zero to de-select all.)
'SelectIndex Index to 'SelectItem. Set this to point to a selected element; e.g., set to 1 to point at the first item selected, 2 to point at the second item selected, etc.
 
The following property applies to lists only:
'SelectItem Item number in list selected. This returns the sequential location within the list of the item being pointed at by the 'SelectIndex property.

Refer to the LIST_BOX Directive or the GRID Directive for more information on the controls described.
 
Example:

FOR I = 1 TO LB1'SelectCount
LB1'SelectIndex = I
PRINT LB1'SelectItem
NEXT

 
     
In Treeviews In addition to the above properties, Treeview controls support the following:
'SelectedChildren Number of child items selected
'SelectStateMask State filter to apply..

Use 'SelectedChildren in conjunction with 'SelectedStateMask to return the number of child items with the desired state.

When 'SelectedStateMask is set, the 'SelectCount, 'SelectIndex, and ’SelectItem properties will reflect only those items that have the specified state; e.g., to find all items that have a state of one, set 'SelectStateMask to 1. 'SelectCount will then indicate the number of items that have this state and sequencing through 'SelectIndex and 'SelectItem will return their item numbers.

   
In Grids The following properties can be applied to grids for access to selected items based on the location defined by 'SelectIndex:
'SelectRow Row number of selected cell.
'SelectColumn Column number of selected cell.
'SelectValue$ Value within selected field.
'SelectText$ Text contained within the highlight.

Example:

6000 ! 6000 - Example using multiple selection properties for a Grid control
6010 CELL_SELECTIONS:
6020 TOTAL_SELECTED=G1'SELECTCOUNT
6030 IF G1'ROWSHIGH<1 OR TOTAL_SELECTED=0 THEN EXIT
6040 FOR T=1 TO TOTAL_SELECTED
6050 LET G1'SELECTINDEX=T
6060 LET SL_VAL$=G1'SELECTVALUE$
6070 LET SL_COL=G1'SELECTCOLUMN
6080 LET SL_ROW=G1'SELECTROW
6090 LET G1'ROW=-1
6100 LET G1'COLUMN=SL_COL
6110 LET SL_COL_TITLE$=G1'VALUE$
6150 MSGBOX "Cell Value: "+PAD(SL_VAL$,50) + SEP + "Column: " + STR(SL_COL) + SEP+"Row: " + STR(SL_ROW) + SEP + "Column Title:" + PAD(SL_COL_TITLE$,50), "Selection Item " + STR(T) + " of " + STR(TOTAL_SELECTED)
6160 NEXT T
6170 EXIT