单击禁用的树视图项。 [英] Clicking on disabled treeview item .

查看:53
本文介绍了单击禁用的树视图项。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含几个子组的树视图。当其中一个子组中的项目被禁用时,如果用户单击禁用的项目,而不是不执行任何操作,则会选择该项目的父项。我想要的行为是在点击禁用的treeviewitem时不做任何事情。



如何实现这一目标?







感谢您的帮助。

解决方案

尝试阅读此链接:



http://social.msdn.microsoft.com/Forums/vstudio/en-US/fb0a2246-90f5-43b1-9d20-51fd3f30f2ce/disable-selection-on-treeview [< a href =http://social.msdn.microsoft.com/Forums/vstudio/en-US/fb0a2246-90f5-43b1-9d20-51fd3f30f2ce/disable-selection-on-treeviewtarget =_ blanktitle =新窗口> ^ ]



FYI这是以下谷歌搜索的第三个结果:

wpf treeview prevent父母选择点击禁用的孩子



您应该能够使用他们用来定义自定义行为的方法。

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.

解决方案

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.


这篇关于单击禁用的树视图项。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆