views:

109

answers:

4

I have a TreeView on my form but I'd like it to always be fully expanded, even the child nodes.

Is there a way?

+2  A: 

Guessing here... On the BeforeCollapsed event, set e.Cancel = true;

Nelson
Probably a combination of what I said plus what Ashton said. Is this for a WinForm or a WebForm? I think they both have a TreeView control.
Nelson
+4  A: 

Do you want it to initially display expanded? If so, then call the ExpandAll method on the root node after you have added all of the tree nodes.

If you want it to display expanded and not allow the user to collapse it, then you need to handle the BeforeCollapsed event and cancel it.

Scott Dorman
A: 

TreeView.ExpandAll Method

Will Marcouiller