System.Web.UI.WebControls.TreeNode.SelectAction Property

Gets or sets the event or events to raise when a node is selected.

Syntax

[System.ComponentModel.DefaultValue(System.Web.UI.WebControls.TreeNodeSelectAction.Select)]
public TreeNodeSelectAction SelectAction { set; get; }

Value

Documentation for this section has not yet been entered.

Remarks

The text of a node in the System.Web.UI.WebControls.TreeView control can be in one of two modes: selection mode or navigation mode. By default, a node is in selection mode. To put a node into navigation mode, set the node's TreeNode.NavigateUrl property to a value other than an empty string (""). To put a node into selection mode, set the node's TreeNode.NavigateUrl property to an empty string.

Note:

When a node is in navigation mode, selection events are disabled for that node. Clicking a node will direct the user to the specified URL, rather than posting the page back to the server and raising an event.

When a node is in selection mode, use the TreeNode.SelectAction property to specify which event or events are raised when a node is selected. The following table lists the available options.

TreeNodeSelectAction.Expand

Toggles the node between expanded and collapsed. Raises the TreeView.TreeNodeExpanded event or the 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 the TreeView.TreeNodeExpanded events when a node is selected. Nodes are only expanded, never collapsed.

Note:

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

The value of this property is stored in view state.

Requirements

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