Concept Framework 1.0 documentation Contents | Index

RComboBox.AddItem

Name Type Access Version Deprecated
AddItem function public version 1.0 no

Prototype:
public function AddItem(item)

Parameters:
item      the item to add

Description:
This function adds an item in the combo box. If the Sorted property is set to true, then the item is inserted at the right position in order to maintain the combo list sorted. Other ways, the item is just added at the end of the list. In addition, after calling AddItem you cannot set the Sorted property to true (resulting in an exception).
Item must be a string, number or RImage depending on the column type or an array containing elements of the string, number or RImage. The array must have at least one item for each column, respecting the column type; first array element must have the type of the first column and so on. However, the array can have more items than the number of columns, in which case the exceeding number of items will be not be displayed in the combo list.

Example:
	// for combo with one column

Combo.AddItem("Joe");

// for combo with two columns
Combo.AddItem(["Joe","Black"]);

// also, if you added one column as IMAGE_COLUMN and another one as COLUMN_NORMAL
myImage=new RImage(null);
myImage.Filename="picture.jpg";
Combo.AddItem([myImage, "me at the pet shop"]);

Returns:
Returns the index of the row in which the item was added.

Documented by Eduard Suica, generation time: Thu Oct 15 20:01:55 2009 GMT(c)2009 RadGs Software