Does anyone know how to hide the [-] button for a treeview? The treeview will never be collapsed, and therefore I dont need the root node to have the collapse option. I know
This should work. You need to modify the ControlTemplate of the TreeViewItem, the [+] / [-] button is actually a ToggleButton inside the TreeViewItem's ControlTemplate so all you need to do is set its visibility to hidden or collapsed.
Create a project called "StackOverflowTests" (so you don't have to change anything) and paste this code in your Window1.xaml file. Should work right out of the box:
False
True
True
False
False