|
|
|
SftTreeItems.Insert Method |
Inserts a new item at the specified index position.
Syntax
VB.NET |
ItemIndex = object.Insert(ByVal AtIndex As Integer, ByVal Text As String) As Integer |
||
VB |
ItemIndex = object.Insert(ByVal AtIndex As Long, ByVal Text As String) As Long |
||
C#.NET |
int ItemIndex = object.Insert(int AtIndex, string Text); |
||
VC++ |
long ItemIndex = object->Insert(long AtIndex, _bstr_t Text); |
||
C |
HRESULT object->raw_Insert(long AtIndex, BSTR Text, long* ItemIndex); |
||
Delphi |
ItemIndex := object.Insert(AtIndex : Integer; Text : WideString) : Integer; |
object
A SftTreeItems object.
AtIndex
The zero-based index of the position where the item will be inserted. If -1 is specified, the item is added at the end of the list.
Text
The text to be used for the item's first (or only) column.
ItemIndex
Returns the zero-based index of the newly inserted item.
Comments
The Insert method inserts a new item at the specified index position.
By default, new items are added at level 0. Use the Item.Level property to change an item's level. If many items have to be added, the BulkUpdate property can be used to indicate a mass-update, which is significantly faster.
Once an item has been added, the Cell.Text property can be used to change the text for any of the available columns.
Items can be added at the end of the list by using the Items.Add method. Items can be deleted using the Items.Remove method.
When a tree control is populated using Items.Add or Items.Insert, the Items.RecalcHorizontalExtent method can be used to have the tree control calculate the optimal horizontal scrolling area so scroll bars are enabled, depending on the Scrollbars property.
If a parent item is collapsed, subsequently adding child items will automatically expand the item.
Items can also be added using the Items.InsertAfter method.
See Also SftTreeItems Object | Object Hierarchy