RTreeView.InsertItem


public function InsertItem

Prototype:

public function InsertItem(position, item)

Parameters

position
the position(index as number or path as string or array) where to insert the item
item
the item to insert at the given position

Description:

This function inserts an item at the given position. The item can be a string/number, RImage or RComboBox(for views with one column) or an array of any combination of those for views containing more than one column. Notice that when insert an item, you must provide all the columns for multi-columns views. When the Sorted property is set to true, the position parameter is ignored and this function is acts similar to AddItem.

Return value:

This function returns -1 if the position is invalid, or the position otherwise.

Example
	// for views with one column, insert at the fifth position
	TreeList.InsertItem(5, "column");
	// for views with two columns, insert at the fifth position
	TreeList.UpdateItem(5,["column one","column two"]);
	// also, if you added a column as IMAGE_COLUMN
	myImage=new RImage(null);
	myImage.Filename="picture.jpg";
	TreeList.InsertItem(5,myImage);