SetSelectedIndex

Definition:

SetSelectedIndex(control, index)

 

Description:

Select an item within a List Box, Combo Box or ListView Control based on its position within the list of items.

 

Platforms:

All

 

Parameters:

control - required

Name of the relevant control.

 

index - optional

Integer value specifying index of item in list to be selected. The first item in the list has an index of 0 (zero).

-1 = no item to be selected.

 

Returns:

nothing

 

Notes:

  • This Method changes the selected item but doesn't scroll the list to display the newly selected item.

  • The currently selected row in a ListView Control is automatically set to be the current record, you do not need to call SelectRecord. On Android and iOS devices, if the control's Show Selection in Touch Mode Property is set to False, the currently selected row within a ListView will not be highlighted on the actual display.

  • If you specify an index which is out of range, the selection will not change and the previously selected item will remain the current selection.

  • For Dropdown Combos, if you specify an index of -1, the Edit Box will be cleared.


See also:

SetTimerInterval

GetControlEnabled