Partager via


SELECTEDNODEINDEX Attribute | selectedNodeIndex Property

Sets or retrieves the index of the selected TreeNode.

Syntax

HTML <namespace:TREEVIEW SELECTEDNODEINDEX = sSelectedNodeIndex... >
Scripting TREEVIEW.selectedNodeIndex [ = sSelectedNodeIndex ]

Possible Values

namespace Prefix that associates a custom tag with an XML namespace. This prefix is set using the XMLNS attribute of the html tag.
sSelectedNodeIndex String that specifies or receives the index of the selected node.
0
Default. The index of the top-level node in the tree.

The property is read/write. The property has a default value of 0.

Remarks

To retrieve the TreeNode object, pass this index to the getTreeNode method.

The structure of the index returned by this method is a concatentation of the ordinal number of the parent node at each level counting through the tree from 0 down to the selected node and delimiting each level with a dot (.). The uppermost node in the top level of the tree is 0; the second node is 1, and so on. The node that immediately follows the first top-level node is 0.0; the second is 0.1, and so on. For example, for the index value 1.3.2, 1 is the second node at the top level of the tree; 3 is the fourth node under node 1; and 2 is the third node under node 1.3 and it is the selected node.

This property can only be set for visible TreeNode elements.

Applies To

TREEVIEW

See Also

Internet Explorer WebControls, About the TreeView WebControl