TreeNode::SelectAction Property
Gets or sets the event or events to raise when a node is selected.
Assembly: System.Web (in System.Web.dll)
public: property TreeNodeSelectAction SelectAction { TreeNodeSelectAction get(); void set(TreeNodeSelectAction value); }
Property Value
Type: System.Web.UI.WebControls::TreeNodeSelectActionOne of the TreeNodeSelectAction values. The default is TreeNodeSelectAction.Select.
The text of a node in the 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 NavigateUrl property to a value other than an empty string (""). To put a node into selection mode, set the node's 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 SelectAction property to specify which event or events are raised when a node is selected. The following table lists the available options.
Selection action | Description |
|---|---|
TreeNodeSelectAction.Expand | Toggles the node between expanded and collapsed. Raises the TreeNodeExpanded event or the TreeNodeCollapsed event as appropriate. |
TreeNodeSelectAction.None | Raises no events when a node is selected. |
TreeNodeSelectAction.Select | Raises the SelectedNodeChanged event when a node is selected. |
TreeNodeSelectAction.SelectExpand | Raises both the SelectedNodeChanged and the TreeNodeExpanded events when a node is selected. Nodes are only expanded, never collapsed. |
Note |
|---|
The HoverNodeStyle property is not rendered for a node with its SelectAction property set to TreeNodeSelectAction.None. |
The value of this property is stored in view state.
Available since 2.0
