PROJECT DESCRIPTION
I have, over the past couple of weeks, found myself writing the same, or similar code over and again. Particularly, I've been writing code to do searches of the RadTreeView starting a any given level, some times searching all of a node's dependants, sometimes, just the child nodes of that node.

Being basically a lazy guy, I decided to write a couple of extensions I could use in my programming without having to go through all the hassle of sub-classing this or that telerik control class.

The following shows a couple of extensions that allow you to:

do a generic search of all dependent nodes of a given node or treeview;

sort the nodes collection of a treeview or tree node and, if required, apply that sort method recursively through all dependent nodes of the start point.

I have no doubt that the majority of readers can tell me more about generic types and methods applying to them than I could hope to know, so I'll keep this brief.

The first of these 2 overloads limits the search to the immediate children the treeview or node it is applied to, the second acts recursively through all the dependent child nodes of the starting point if the Deep parameter is true.

Because the method use Predicate<RadTreeNode> the search criterion can be as complex as you need it to be. If the code is using C# v3 or later it can also be written using lambda notation. So, it is possible to search using code like this...

MARDI

Stuart,
I am trying to use a tree view control to view config file key value pairs. I've used a XML data source to load the control and set the xpath property to "/Configuration". It loads well except when it gets to the <add key="" value""/> . Of course the control doesn't understand how to interpret the "add" node. How would I change that?

Progress, Telerik, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries. See Trademarks or appropriate markings.