System.Web.UI.WebControls.TreeView.OnSelectedNodeChanged Method

Raises the TreeView.SelectedNodeChanged event of the System.Web.UI.WebControls.TreeView control.

Syntax

protected virtual void OnSelectedNodeChanged (EventArgs e)

Parameters

e
An EventArgs that contains event data.

Remarks

The TreeView.SelectedNodeChanged event is raised when a node is selected in the System.Web.UI.WebControls.TreeView control. This allows you to provide an event-handling method that performs a custom routine, such as updating the displayed content, whenever this event occurs.

You can optionally set the TreeNode.SelectAction property of a node to specify which event is raised when that node is selected.

Note:

The TreeView.HoverNodeStyle is not rendered for a node with its TreeNode.SelectAction property set to TreeNodeSelectAction.None.

Raising an event invokes the event handler through a delegate. For more information, see Consuming Events.

The TreeView.OnSelectedNodeChanged(EventArgs) method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.

Requirements

Namespace: System.Web.UI.WebControls
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 2.0.0.0
Since: .NET 2.0