如何知道treeview中的checked节点是否为父节点..asp.net c# [英] How to know if checked node in treeview is a parent node..asp.net c#
本文介绍了如何知道treeview中的checked节点是否为父节点..asp.net c#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个父节点和子节点的树视图。我怎么知道我所拥有的已检查节点是父节点?我正在使用CheckedChanged事件进行树视图。
谢谢,
Franco Cipriano
Hi,
I have a treeview with a parent and child node. How do I know that the checked node that I have is a parent node?I am using the CheckedChanged event for treeview.
Thanks,
Franco Cipriano
推荐答案
查看其Nodes属性 - 如果集合为空,则它不是父...
Look at its Nodes property - if the collection is empty, it is not a parent...
您好,
试一试如下....
Hi,
Give it a try as follows....
if (selectedNode.Parent == null)
{
MessageBox.Show("The node does not have a parent.");
}
问候
Sebastian
Regards
Sebastian
谢谢非常,我明白了
这篇关于如何知道treeview中的checked节点是否为父节点..asp.net c#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文