Gets a System.Web.UI.WebControls.TreeNode object that represents the selected node in the System.Web.UI.WebControls.TreeView control.
Documentation for this section has not yet been entered.
The text of a node in the System.Web.UI.WebControls.TreeView control can be in one of two modes: selection mode and navigation mode. By default, a node is in selection mode. To put a node into navigation mode, set the TreeNode.NavigateUrl property for the node to a value other than an empty string (""). To put a node into selection mode, set the TreeNode.NavigateUrl property for the node to empty string ("").
When a node is in selection mode, the user can select a node by clicking on the text in the node. Use the TreeView.SelectedNode property to determine which node is selected in the System.Web.UI.WebControls.TreeView control.
A node cannot be selected when the System.Web.UI.WebControls.TreeView control displays hyperlinks. When hyperlinks are displayed, the TreeView.SelectedNode property always returns null.
When the user selects a different node in the System.Web.UI.WebControls.TreeView control by clicking the text in the new node, the TreeView.SelectedNodeChanged event is raised, by default. You can specify a different event by setting the TreeNode.SelectAction property for the property. The following table lists the available options.
TreeNodeSelectAction.Expand |
Toggles the node between expanded and collapsed. Raises the TreeView.TreeNodeExpanded or TreeView.TreeNodeCollapsed event, as appropriate. |
TreeNodeSelectAction.None |
Raises no events when a node is selected. |
TreeNodeSelectAction.Select |
Raises the TreeView.SelectedNodeChanged event when a node is selected. |
TreeNodeSelectAction.SelectExpand |
Raises both the TreeView.SelectedNodeChanged and TreeView.TreeNodeExpanded events when a node is selected. Nodes are only expanded, never collapsed. |
The TreeView.HoverNodeStyle is not rendered for a node with its TreeNode.SelectAction property set to TreeNodeSelectAction.None.