Hide

SftTree/NET 2.0 - Tree Control for Windows Forms

Display
Print

Expanding and Collapsing Items

SftTree/NET supports expanding and collapsing tree items with minimal application intervention. 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 SftTree.AutoRespond property allows the tree control to expand and collapse items automatically or under program control. Under program control, an application can respond to the ItemClick event, ItemDoubleClick event and expand or collapse items using the ItemClass.Expand and ItemClass.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 ItemClass.ExpandCollapseButton 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 event or ItemCollapsed event occurs.