Thank you for your help. I'd like to give back to the Telerik developers community if I may . . .
In my case I've been testing out your treeview to use it as the main navigation tool for accessing a bunch of related data. To keep track of the last selected RadTreeNode I've introduced a modular level property called "PreviousNodeID". Originally I just generated a GUID and stored it in a node attribute called "id". That worked well ... when I was using the ExpandMode property set to "ServerSide".
My recent testing has revealed "ServerSideCallBack" to be much faster (and understandably why!). In trying to switch over everything to this faster ExpandMode setting I discovered that the "id" attribute was not appearing. So then I got to wondering, why don't I just use each node's "UniqueID" value instead, storing the the last one into "PreviousNodeID"? This change actually worked a lot better except for two things:
- You can search a treeview for a node via an attribute value but cannot search for a node via its UniqueID property.
- When you drag & drop a node its UniqueID value changes.
To resolve issue #1 I created this method:
/// Every node has a Unique ID value. There's no built-in method to locate a node in a treeview via its Unique ID.
/// This method accomplishes that.
/// <param name="treeView"></param>
public static RadTreeNode FindNodeByUniqueID(RadTreeView treeView, string uniqueID)
RadTreeNode foundNode = null;
int nodeCount = treeView.GetAllNodes().Count;
RadTreeNode allNodes = new RadTreeNode[nodeCount];
foreach (RadTreeNode node in allNodes)
if (node.UniqueID == uniqueID)
foundNode = node;
To resolve issue #2 I just stored the new [changed] UniqueID value into my PreviousID property.
Now I have a UI that works faster and there's actually a bit less code than before. I'd say that's a Win-Win!!
Hopefully this will help someone else too,