TreeNode.SelectAction Property
Assembly: System.Web (in system.web.dll)
public: property TreeNodeSelectAction SelectAction { TreeNodeSelectAction get (); void set (TreeNodeSelectAction value); }
/** @property */ public TreeNodeSelectAction get_SelectAction () /** @property */ public void set_SelectAction (TreeNodeSelectAction value)
public function get SelectAction () : TreeNodeSelectAction public function set SelectAction (value : TreeNodeSelectAction)
Not applicable.
Property Value
One 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.
| Topic | Location |
|---|---|
| How to: Add or Delete TreeView Node Elements (Visual Studio) | Building ASP .NET Web Applications in Visual Studio |
Note: