Share via


SELECTEDNODEINDEX Attribute | SelectedNodeIndex Property

Sets or retrieves the index of the selected node.

Syntax

Visual Basic  Public  Property SelectedNodeIndex As string
C# public  string SelectedNodeIndex { get; set; }
Managed C++ public:  __property string get_SelectedNodeIndex();
public:  __property void set_SelectedNodeIndex(string);
JScript public   function get SelectedNodeIndex() : string;
public   function set SelectedNodeIndex(string);

Possible Values

sSelectedNodeIndex string that specifies or receives the index of the selected node.
0Default. 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 GetNodeFromIndex method.

The structure of the index returned by this mehtod is a concatenation of the ordinal number of the parent node at each level counting through the tree from 0 to the selected node and delimiting each level with a dot (.). The upper-most 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.

An exception is thrown if the index is invalid or is set to a non-visible TreeNode index.

Applies To

See Also

Internet Explorer WebControls, About the TreeView WebControl