How to make a WPF tree view non-collapsible and non-selectable
I want to display data from and XML document in a tree-like display but I don't need items to be selectable and I don't want them t开发者_如何学编程o be collapsible.
Any way to do this with TreeView? Is TreeView even the right control to use?
Thanks!
You can handle the PreviewMouseDown and cancel the event. If you need to allow scrolling, you can do a HitTest and see if it is over the "ScrollerChrome". If you need more details, I can provide code.
精彩评论