Post two about treeview
// Initialize the selected node
Function initchecknode ()
{
Var node = TreeView1.gettreenode ("1");
Node.setttribute ("Checked", "True");
SetCheck (Node, "True");
FindcheckedfromNode (TreeView1);
}
// oncheck event
Function Tree_Oncheck (Tree)
{
Var node = tree.gettreenode (tree.clickednodeIndex);
Var pchecked = tree.gettreenode (Tree.clickedNodeIndex) .GetaTRibute ("Checked");
SetCheck (Node, PChecked);
Document.all.Checked.Value = "";
Document.all.unchecked.value = "";
FindcheckedfromNode (TreeView1);
}
// Set the child node selection
Function SetCheck (Node, PC)
{
Var i;
Var childnode = new array ();
ChildNode = node.getchildren ();
IF (parseint (childnode.length) == 0)
Return;
Else
{
For (i = 0; i { VAR CNODE; CNODE = ChildNode [i]; IF (CNode.getChildren (). Length)! = 0) SetCheck (CNODE, PC); Cnode.setttribute ("Checked", PC); } } } // Get all node status Function FindcheckedfromNode (Node) { VAR i = 0; Var nodes = new array (); Nodes = node.getchildren (); For (i = 0; i VAR CNODE; CNODE = NODES [I]; IF (cnode.getattribute ("checked"))) AddChecked (CNODE); Else Addunchecked (CNODE); IF (parse.getchildren (). Length)! = 0) { FindcheckedfromNode (CNODE); } } } // Add a selected node Function addChecked (node) { Document.all.checked.Value = node.getattribute ("nodedata"); Document.all.checked.value = ','; } // Add unselected node Function addunchecked (node) { Document.all.unchecked.Value = node.getattribute ("nodedata"); Document.all.unchecked.Value = ',';} // -> script> How to get the node after the server side is selected in the TreeView Private void Button1_Click (Object Sender, System.Eventargs E) { Response.write (TreeView1.Nodes [0] .checked); } script> Function set_check () { Var nodeIndex = "0"; Var node = TreeView1.gettreenode (NodeIndex); Node.setttribute ("Checked", "True"); TreeView1.QueueEvent ('oncheck', nodeIndex); } script>