TreeListView和复选框 [英] TreeListView and Checkbox

查看:78
本文介绍了TreeListView和复选框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用TreeListView(来自Philip Piper的ObjectListView)和复选框,我现在面临的问题是我如何仅对子注释而不对父节点显示/启用复选框?

I''m using the TreeListView (from ObjectListView of Philip Piper) and the checkbox, the problem i''m facing right now is that how can I show/enable the checkbox only for the childnote but not the parent node?

推荐答案

^ ]涉及到一些讨论,您可能会找到一种方法,并且就您尚未陈述的人们无法想象的UI类型而言.
HERE[^] is a little discussion regarding, you may find a way and As far as you haven''t stated type of UI people can not suppose about.


您需要手动遍历节点并显示/隐藏所需的节点.要隐藏除根节点以外的所有节点,请执行此操作.

You need to manually loop through the nodes and show/hide the ones you want. To hide all nodes except for the root, do this.

foreach (TreeListNode aNode in YourTreeListView.Nodes)
 foreach (TreeListNode aNode2 in aNode.Nodes)
  aNode2.CheckBoxVisible = false;



假设只有一个级别的孩子.只显示孩子们这样做.



Assuming there is only one level of children. To only show the Children do this.

foreach (TreeListNode aNode in YourTreeListView.Nodes)
  aNode.CheckBoxVisible = false;



谢谢,
HH



Thanks,
HH


这篇关于TreeListView和复选框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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