|
|
|
Expanding/Collapsing Items |
SftTree/OCX supports expanding and collapsing tree items with minimal application intervention. Items in a tree control are managed as a linear list, or array, of items. The application can expand and collapse items without having to add or remove items. The tree control takes care of hiding and making items visible as needed. The expand/collapse buttons are automatically displayed as needed for parent items with dependent items.
The AutoRespond property allows the tree control to expand and collapse items automatically or under program control. Under program control, an application can respond to ItemClick and ItemDblClick events and expand or collapse items using the Item.Expanded property or the Item.Expand and Item.Collapse methods.
An application can also fully control expanding and collapsing tree items. Rather than adding all items, including dependent items (child items), an application can add all parent items and mark them as expandable without actually adding the dependent items (see the Item.Expandable property). Then, once the application receives an ItemClick event, signaling that the user wants to expand a parent item, the application can add the dependent items.
When items are expanded or collapsed, the ItemExpanded or ItemCollapsed events occur.