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.
| Topic | Location |
|---|---|
| How to: Add or Delete TreeView Node Elements (Visual Studio) | Building ASP .NET Web Applications in Visual Studio |
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Note