How can this be done?
Thanks!
11 Answers, 1 is accepted

In order to implement this, you can follow the same logic in the following code library.
TreeNode searching.
Thanks,
Shinu.

such as Parent 1
child1 of parent1
child of child1
In order to make Shinu's "solution" to work, you can make the method recursive and remove the nested loop.
Regards,
Nikolay Tsenkov
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Here you are, this should do the job:
void
LoopNodes(RadTreeNodeCollection nodes)
{
foreach
(RadTreeNode node
in
nodes)
{
// process node
if
(node.Nodes.Count > 0)
{
LoopNodes(node.Nodes);
}
}
}
Regards,
Nikolay Tsenkov
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

i should responded earlier but what i found out is that i have always located the node that was being searched..
the problem was expanding the parent of the multi level nodes..
using node.parent.prev does work but sometimes it doesnt..is there a better way of doing it the telerik way?
what i also did was use the get path and loaded those in an array with the ID and expanding the nodes by its id/value this is what i did such as id = pk in path (4-79-100-210) expand(4) expand(79) expand (100) etc..
I am not exactly sure I understand what seems to be the problem that you experience.
Could you, please, explain it in a bit more detail?
What I am definitely sure, is that this code, cannot span more than the second level of nodes:
//FindTreeNode function
private
void
FindTreeNode(String treeNode)
{
//Looping through each node in the treeview
foreach
(RadTreeNode node
in
RadTreeView1.Nodes)
{
//Checking the node name with the node name entered in the textbox
if
(node.Text == treeNode)
{
//if the node name equal to the node name entered in the textbox setting the selected property of the node to true
node.Selected =
true
;
}
else
{
node.Selected =
false
;
}
//Looping through the child nodes
for
(
int
i = 0; i < node.Nodes.Count; i++)
{
if
(node.Nodes[i].Text == treeNode)
{
//if the node name equal to the node name entered in the textbox setting the selected property of the node to true and expanding that node.
node.Expanded =
true
;
node.Nodes[i].Selected =
true
;
}
else
{
node.Nodes[i].Selected =
false
;
}
}
}
}
Regards,
Nikolay Tsenkov
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

what i mean is that i thought my query was not loading every node, but it was..and find node by value and getting the path confirms this, and even expanding the whole tree and locating the node confirms this, however is there a way to expand the node by the value?and that including the parent(s) node?
You can get the node using the FindNodeByValue method of RadTreeView's.
Then you can expand its parent nodes using the ExpandParentNodes method of RadTreeNode's and expand the node itself - "node.Expand = true;".
Regards,
Nikolay Tsenkov
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

this is what i needed "ExpandParentNodes"
replaced my 5 line code!
Thanks!