RTreeView.AddItem


public function AddItem

Prototype:

public function AddItem(item)

Parameters

item
the item to add

Description:

This function adds an item in the view. Regardless value of Model property, the item will be added on the top level (it won't be the child of any other item). If the Sorted property is set to true, then the item is inserted at the right position in order to maintain the view 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, RImage or RComboBox depending on the column type or an array containing elements of the string, number, RImage or RComboBox. 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 view.

Return value:

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

Example
	// for views with one column
	TreeList.AddItem("Joe");	
	// for views with two columns	
	TreeList.AddItem(["Joe","Black"]);	
	// also, if you added one column as IMAGE_COLUMN and another one as NORMAL_COLUMN
	myImage=new RImage(null);	
	myImage.Filename="picture.jpg";
	TreeList.AddItem([myImage, "me at the pet shop"]);