I\'m trying to populate a treeview from an XmlDocument. The Root of the tree is set as \'Scripts\' and from the root the next level should be \'Departments\' which is within the
Depending upon the size of your XML file, you could consider using an associated List
for fast lookup. As you add each node to the TreeView
also add it to the List
.
It depends on the structure of your input. Since you don't show how exactly you add your subnodes I can only point you towards either the Contains
or the ContainsKey
method of the Nodes property, either of the treeView1
itself, or of any subnodes you add. You should use an overload of the Add
method to specify a key name to simplify lookup.