Hide

SftTree/OCX 7.5 - ActiveX Tree Control

Display
Print

AddItem Method, SftTree Object

Adds a new item at the end of the list.

Deprecated - Provided for compatibility with earlier versions only - Use Items.Add instead

Syntax

VB.NETItemIndex = object.AddItem(ByVal Text As String) As Integer
VBItemIndex = object.AddItem(ByVal Text As String) As Long
C#.NETint ItemIndex = object.AddItem(string Text);
VC++long ItemIndex = object->AddItem(_bstr_t Text);
CHRESULT object->raw_AddItem(BSTR Text, long* ItemIndex);

object

A SftTree object.

Text

The text to be used for the item's first (or only) column.

ItemIndex

Returns the zero-based index of the newly added item.

Comments

Deprecated - Provided for compatibility with earlier versions only - Use Items.Add instead

The AddItem method adds a new item at the end of the list.

New items added using the Items.Add method are always added at the end of the list. 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 or inserted, 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 inserted at a specific location using the Items.Insert 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.

See Also SftTree Object | Object Hierarchy


Last Updated 08/13/2020 - (email)
© 2024 Softel vdm, Inc.