Hi,
I want to know how to use the GetNodeByKey() method.
It doesn't appear to work, so can you tell me if I'm missing something.
Here is the code I use:
RadTreeNode node = new RadTreeNode("node1");
node.Key = 1;
this.radTreeView1.Nodes.Add(node);
node = new RadTreeNode("node2");
node.Key = 2;
this.radTreeView1.Nodes.Add(node);
// Won't be able to find the node with key = 2, messagebox will appear
RadTreeNode selected = this.radTreeView1.GetNodeByKey(2);
if (selected == null)
MessageBox.Show("couldnt find selected node with key=2 using GetNodeByKey()");
// this should find it ok.
foreach (RadTreeNode radNode in this.radTreeView1.Nodes)
{
if (Convert.ToInt32(radNode.Key) == 2)
MessageBox.Show("Found node with key = 2");
}
Regards,
Phi Le