views:

393

answers:

3

Hey guyz!

I have a .net 2.0 C# Project. I have a Treeview with 2 Nodes, each of them has many child nodes. When you click on a child node, a PDF is displayed in a webbrowser control depending on the properties of the node. Fine, but the problem is that when both Nodes are expanded, and I click on a child node, the other node gets collapsed! I don't have any code that collapses any node of the treeview, but somehow it happens! I also had a look at the BeforeCollapse Event, but somehow it doesn't fire, alltough the other node collapses!

Can anyone imagine why this happens? I would be very grateful if anyone can teach me how to prevent this happening!

Thank you very much!

A: 

Hi,

I am facing the same issue. If you have any solution to this problem then please reply.

A: 

This happens if the TVS_SINGLEEXPAND style is ON for the treeview. Try setting the HotTracking property to false.

logicnp
A: 

I stopped using the WinForms TreeView some time ago because of it's limits and quirks.

My favorite replacement is the open-source TreeViewAdv:

TreeViewAdv on Source Forge

TreeViewAdv on CodeProject

Eric J.