ObjectDCL Banner

Grid_SetItemDropList Method

Description

This method will set the drop down lists for cells with the styles. If the column has been preset with list items, this function will override that list(s) for the specified cell only.

Parameters

MyControlReference
Reference to the control in the form of MyProject_MyForm_MyControl.
ProjectFile
String identifying the project as it was passed in LoadProject.
DialogName
String identifying the dialog by name.
ControlName
String identifying the control by name.
nRowIndex
Integer specifying row index.
nColIndex
Integer specifying column index.
sChoiceTextX
String specifying the new text for the choice.
sChoiceValueX
Integer specifying the corresponding value for the choice.

Return Values

Returns the following according to the situation:

  • T when successful.
  • Nil if the control is not found, does not support this function or if there is no such row or column.

AutoLISP Syntax

The recommended convention is passing the control identifier directly:

CopyCode imageCopy Code
(Odcl_Grid_SetItemDropList 
		MyControlReference [as Reference]
		nRowIndex [as Integer]
		nColIndex [as Integer]
		(list
			sChoiceText1 [as String]
			[Optional] sChoiceValue1 [as Integer]
			sChoiceText2 [as String]
			[Optional] sChoiceValue2 [as Integer]
			...
			sChoiceTextN [as String]
			[Optional] sChoiceValueN [as Integer]
		)
	)

An alternative convention is to identify the control by providing the project file, the dialog name and the control name:

CopyCode imageCopy Code
(Odcl_Grid_SetItemDropList
		ProjectFile [as String]
		DialogName [as String]
		ControlName [as String]
		nRowIndex [as Integer]
		nColIndex [as Integer]
		(list
			sChoiceText1 [as String]
			[Optional] sChoiceValue1 [as Integer]
			sChoiceText2 [as String]
			[Optional] sChoiceValue2 [as Integer]
			...
			sChoiceTextN [as String]
			[Optional] sChoiceValueN [as Integer]
		)
	)

Remarks

The style set to the cell or column only governs the behavior of the cell and what happens when the user clicks on the cell.

For example if you set the style 38 - Integers Combo, all the items to be added to the drop list must be as strings. You are responsible to ensure the correct text is added.

Applies For

EditableGrid.

Example

CopyCode imageCopy Code
; Update the text of the third row on the fourth column
(Odcl_Grid_SetItemDropList MyProject_MyForm_MyControl 
	(list "Debit Card" 0 "Credit Card" 1 "Check" 3))

See Also

Grid_GetItemCheck, Grid_GetItemData, Grid_GetItemImage, Grid_GetItemText, Grid_SetItemCheck, Grid_SetItemData, Grid_SetItemImage, Grid_SetItemStyle, Grid_SetItemText