I have started working with the Telerik RadControls for ASP.Net AJAX recently and decided to start posting some helpful code snippets that I keep using.
This first snippet allows you to set a particular Tree Node to be the selected one. In the code I am passing in a specific string value that corresponds to one of the tree’s node value properties. This then returns an instance of the particular Node which then exposes a Selected attribute.
On thing to be aware of is that the Tree control itself has a SelectedNode (RadTreeView1.SelectedNode) property but this is a read only attribute to get the currently selected node, not an exposed attribute for setting it.
RadTreeNode node = RadTreeView1.FindNodeByValue(“Node123”);
if (node != null)
node.Selected = true;