Click here to Skip to main content
16,021,115 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have a treeview which contains several sub-groups. When an item in one of these sub-groups is disabled and if the user clicks on the disabled item , instead of not doing anything , the parent of the item gets selected. The behavior i want is just not do anything when a disabled treeviewitem is clicked.

How do I achieve this?



Thanks for any help.
Posted
Comments
Hellraiser123 24-Sep-13 4:15am    
I was able to solve this issue by following the approach proposed in this thread...

http://social.msdn.microsoft.com/Forums/vstudio/en-US/50a5bd44-7508-408e-94b3-1c83326c382f/click-on-disabled-treeview-item

1 solution

Try reading this link:

http://social.msdn.microsoft.com/Forums/vstudio/en-US/fb0a2246-90f5-43b1-9d20-51fd3f30f2ce/disable-selection-on-treeview[^]

FYI it was the third result for the following google search:
"wpf treeview prevent parent select on click of disabled child"

You should be able to use the approach they are using to define custom behavior.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900