Reputation: 11
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!
Upvotes: 1
Views: 2116
Reputation: 150108
I stopped using the WinForms TreeView some time ago because of it's limits and quirks.
My favorite replacement is the open-source TreeViewAdv:
Upvotes: 1
Reputation: 5836
This happens if the TVS_SINGLEEXPAND style is ON for the treeview. Try setting the HotTracking property to false.
Upvotes: 0