TreeView Web Server Control Events
The TreeView Web server control provides several events that you can program. This allows you to run your custom routines whenever an event occurs.
TreeView control events are raised only when a user interacts with the control by doing such things as selecting, expanding, or collapsing a node. They are not raised if the select, expand, or collapse methods are called programmatically. For example, if you call the Expand method, no event will be raised.
The following table describes the events that are supported by the TreeView control.
Occurs when a node is selected in the TreeView control.
Occurs when a node is expanded in the TreeView control.
Occurs when a node is collapsed in the TreeView control.
Occurs when a data item is bound to a node in the TreeView control.
The SelectedNodeChanged Event
The following code example demonstrates handling the SelectedNodeChanged event and accessing the SelectedNode property that raised the event. It sets the text of MyLabel to be the ToolTip property text of the SelectedNode.