Hello, i think i've tried just about every option i can find to Collapse the ChildNodes of the Level==0 parent i suspect that is has something to do with the fact that i'm not actually using the " e " in e.Nodes.... to try and do the actual process but i'm trying to use the actual RadTreeView ID collection itself, but the reason i'm doing that is because i want to Collapse all of the Level 0 AAAA node when i then select the Level 0 BBBB node for instance, so if i tried to use the " e " value i would be pointing to the BBBB node which i what i want to expand, but before i expand it, i want to Collapse the AAAA node just for example. thanks for any ideas or suggestins! protected void trvDB2_NodeExpand(object sender, RadTreeNodeEventArgs e) |
{ |
foreach (RadTreeNode rtn in trvDB2.Nodes) |
{ |
if (rtn.Level == 0 && !e.Node.Text.Equals(rtn.Text)) |
{ |
int rntnc = rtn.Nodes.Count; |
//Nodes ns = rtn.Nodes.Remove(); |
//for (int index = rtn.Nodes.Count - 1; index >= 0; index--) |
for (int index = rtn.Nodes.Count - 1; index >= 0; index--) |
{ |
//string rtnrtntxt0 = rtn.Nodes[index].Text; |
//if (rtn.Nodes[index].Level==1) |
//{ |
// //string rtnrtntxt = rtn.Text; |
// //string rntnit = rtn.Nodes[index].Text; |
// rtn.Nodes.Clear(); |
// //rtn.Nodes[index] |
// //rtn.Nodes[index]; |
// //rtn.Nodes |
//} |
} |
//string x = rtn.Text; |
//IEnumerator ie = rtn.Nodes.GetEnumerator(); |
//while (ie.MoveNext()) |
//{ |
// ((RadTreeNode)(ie.Current)).Nodes.Clear(); |
//} |
//foreach (RadTreeNode rtn2 in rtn.Nodes) |
//{ |
// //string r = rtn |
// //rtn2.Nodes.Clear(); |
// //rtn2.c |
// //rtn2.Nodes.Clear(); |
// //rtn.Nodes.Remove(rtn2); |
//} |
//rtn.Nodes.Remove(); |
//rtn.CollapseChildNodes(); |
//rtn.CollapseParentNodes(); |
} |
} |
for (int index = trvDB2.CheckedNodes.Count - 1; index >= 0; index--) |
{ |
//trvDB2.CheckedNodes[index].Checked = false; |
} |
for (int index = trvDB2.Nodes.Count - 1; index >= 0; index--) |
{ |
string trvnodetxt = trvDB2.Nodes[index].Text; |
if (trvDB2.Nodes[index].Level == 0 && !e.Node.Text.Equals(trvnodetxt)) |
{ |
trvDB2.Nodes[index].CollapseChildNodes(); |
trvDB2.Nodes[index].Nodes.Clear(); |
trvDB2.Nodes[index].Remove(); |
} |
} |
//e.Node.CollapseChildNodes(); |
//e.Node.CollapseParentNodes(); |
//PopulateNodeOnDemand(e, TreeNodeExpandMode.ServerSideCallBack); |
} |