Overview
TeeTree provides comprehensive support for node selection, including single and multiple node selection, programmatic selection, and selection events.Selecting Nodes Programmatically
Select a Single Node
Select All Nodes
Clear Selection
Working with Selected Nodes
Access the First Selected Node
Iterate Through Selected Nodes
Selection Events
TeeTree provides events to respond to selection changes:OnSelectShape Event
Triggered when a node is selected:OnUnSelectShape Event
Triggered when a node is unselected:Selection Properties
Check if a Node is Selected
Get Selection Count
Check if Any Node is Selected
Multiple Selection
TeeTree supports multiple node selection:Complete Example
Here’s a complete example showing selection management:Selection with Keyboard
Users can select nodes using keyboard navigation:- Arrow keys: Navigate between nodes
- Ctrl+Click: Add/remove nodes from selection (with MultiSelect enabled)
- Shift+Click: Select range of nodes (with MultiSelect enabled)
Key Points
- Use
Selectedproperty to programmatically select/deselect nodes - Use
Tree1.Selectedcollection to access all selected nodes - Use
OnSelectShapeandOnUnSelectShapeevents to respond to selection changes - Enable
MultiSelectproperty for multiple node selection - Always check
Assigned(Tree1.Selected.First)before accessing selected nodes - Use
Tree1.Selected.Clearbefore making new selections to avoid accumulation - Iterate backwards when deleting multiple selected nodes to avoid index issues
