开发者

How to make a WPF tree view non-collapsible and non-selectable

开发者 https://www.devze.com 2023-02-23 07:29 出处:网络
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.

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消