Treeview Control

G

Guest

Hello.
I'm using a treeview control and i'm building a search routine. The problem
is that, if the string i'm searching doesn't exists on the Tree, all the
nodes of the tree stay expanded. Is there any method to collapse all the
nodes?

Thanks.
 
D

David C. Holley

If I'm not mistaken, it should be possible to iterate through the .Nodes
collection looking for the specific item(s) without expanding each
PARENT. The display is independent of examining the values. I've got a
bit of code that updates the description of a node when then related
record is updated that operates on looping through the nodes, however as
it the nodes are expanded by default.

Yes, it is possible to collapse all of the nodes via code. However, I do
not know the specific method as I remember reading about it, but didn't
need the functionality at that moment.

David H
 
A

Alex Dybenko

Hi,
to collapse node - set Expanded property to false

search - if you load treeview from the table - could be a good idea to
search in a table and then select found node on the treeview
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top