Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

There are several ways to place new items into the tree. Use the ItemList property to initialize the tree. The ItemList property will always remove all existing items to make way for the new items. If you need to new items later, then use the AddItems or InsertItems methods. The AddItems method will add new child items to an item, while the InsertItems method inserts new items between existing items.

There are other a few methods for moving or copying your tree items. The MoveItems method moves items from one location in the tree to another location within the same tree. The SendItems and TransferItems methods copy items from one tree to another tree.

Finally, removing items can be done with the RemoveItems or RemoveAllItems methods.

Indexing Items

There are more than a dozen properties for modifying an item's attributes. These properties, which all begin with the "Item" prefix, are indexed. Indexed properties are just like normal properties with the addition that they can accept an index parameter. The index allows you to point to a specific item. In the case of the SRP Tree Control, the index is an item key. The syntax for an indexed property looks something like this:

...

Traversing the tree is easy. Use the RootChildren property when you need to start from the very beginning of the tree. If you already have an item key, then use the ItemChildren property to get its children. To traverse upward, use the ItemParent property to get the item's parent.

...

The user, by default, can select only one item a time, but you can use the SelectBehavior to allow for multiple selection or no selection at all. The SelectedItems property can be used to get the current selection or to programmatically change it. Whenever the user changes the selection, the OnSelChange event is fired. Note, however, that the event will not fire when setting the SelectedItems property.