如何在ASP.NET C#中选择树的子树 [英] How to select a sub tree of a tree in asp.net C#

查看:87
本文介绍了如何在ASP.NET C#中选择树的子树的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我实现了一个具有多个节点的树,我想从这个完整的树中选择一个子树......

[edit]删除删除-OriginalGriff [/edit]

I have implement a tree which have a number of nodes what I want to select a sub tree from this full tree...........

[edit]SHOUTING removed - OriginalGriff[/edit]

推荐答案

树形视图设计为一次只能选择一个节点,这很好. br/>
您需要选择一些单个树节点并将其属性Selected分配为true:
http://msdn.microsoft.com/zh-cn/library/system.web.ui.webcontrols.treenode.selected.aspx[^].

选择一个节点完全等同于选择一棵子树,因为一个节点明确表示某个子树.节点本身只有在没有子节点的情况下才是子树,但是如果该节点以及所有子节点(直接子节点和间接子节点)始终是子树,则节点集是一致的.并且,每个子树都由整个树的某个节点明确表示.问题解决了.

—SA
Tree views are designed to select no more than one node at a time, and this is perfectly fine.

You need to pick some single tree node and assign its property Selected to true:
http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.treenode.selected.aspx[^].

Selecting one node is fully equivalent to selecting a sub-tree, because one node unambiguously represents some sub-tree. The node itself is a sub-tree only if it has no children, but the set of node consistent if this node and all children, direct and indirect, is always a sub-tree. And, every sub-tree is unambiguously represented by some node of a whole tree. Problem solved.

—SA


这篇关于如何在ASP.NET C#中选择树的子树的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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