RobertHarris
Fri Jan 07 11:51:04 CST 2005
Hello everyone. I'm joing this thread a bit late, but it looks exactly like
what I am struggling with as well. I've seen the hashtable solution
recommended in several places for this problem. Is there some sample code I
can look at that does exactly this with a treeview? I'm not sure what the
code would look like. Do you add the nodes to the hashtable first, and then
to the treeview?
Thank you very much!
Robert Harris
"Herfried K. Wagner [MVP]" wrote:
> "Harshad Rathod" <HarshadRathod@discussions.microsoft.com> schrieb:
> > What is the most efficient way to search a node in the treeview. I could
> > not
> > find any built in method in that control and walking through the tree does
> > not sound right.
>
> You can store keys in the 'TreeNode''s 'Tag' property. Then you can add the
> nodes to a 'Hashtable' by using the 'Tag' as key. Later you can easily
> lookup the nodes from the hashtable by their key.
>
> --
> M S Herfried K. Wagner
> M V P <URL:
http://dotnet.mvps.org/>
> V B <URL:
http://dotnet.mvps.org/dotnet/faqs/>
>
>