asp.net.ph

TreeNode.SelectAction Property

System.Web.UI.WebControls Namespace   TreeNode Class


.NET Framework version 2.0

Sets or retrieves the event or events to raise when a TreeNode is selected.

Syntax


Inline <asp:treeview selectaction = enumValue ... >
Script [ TreeNodeSelectAction enumValue = ] TreeNode.SelectAction

This property can only be used programmatically; it cannot be set when declaring the control.

Property Value


enumValue One of the TreeNodeSelectAction values.

The property is read only with a default value f Select.

Remarks

Use the SelectAction property to specify which event or events are raised when a node is selected.

The text of a node in a TreeView control can be in one of two modes: selection mode and navigation mode. A node is in navigation mode when the NavigateUrl property for the node is set to a value other than an empty string. Otherwise, the node is in selection mode, wherein the user can select a node by clicking on the node text.

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.

NOTE: This property applies only when a node is in selection mode.

When the user selects a different node in the TreeView control, the SelectedNodeChanged event is raised by default. The TreeView supports specifying a different event to be raised, based on the setting of the SelectAction property. The following table lists the available options.

Selection Action Description
Expand Toggles the node between expanded and collapsed. Raises the TreeNodeExpanded or TreeNodeCollapsed event, as appropriate.
None Raises no events when a node is selected.
Select Raises the SelectedNodeChanged event when a node is selected.
SelectExpand Raises both the SelectedNodeChanged and TreeNodeExpanded events when a node is selected. Nodes are only expanded, never collapsed.

NOTE: The HoverNodeStyle is not rendered for a node with its SelectAction property set to None.

See Also

TreeNode Members Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph