在C#.net中仅显示搜索树节点 [英] Displaying only seraching tree node in c#.net
问题描述
大家好,
在执行节点搜索时,我在widowsform应用程序中有树视图,我需要隐藏所有剩余节点,并且只需要显示搜索到的节点及其父节点.
grandParent
Parent1
child1
child2
child3.
parent2
child4
child5
如果搜索到的节点是< b>子3</b>.我需要把输出显示为..
grandParent
Parent1
child3
所有的小动物都要躲起来.
请问有人在帮我吗?
在此先感谢...
hi To ALL,
I have treeview in widowsform application when searching for node is performed i need to hide all the remainig node and i need to show only the searched node and its parent .like
grandParent
Parent1
child1
child2
child3.
parent2
child4
child5
if the searched node is <b>child 3</b> i need to show the out put as..
grandParent
Parent1
child3
all auother are to be Hide..
is any one worked on this pls Help me......
Thank in advance...
推荐答案
树视图通常无法正常工作-您不会在同一级别隐藏兄弟姐妹.
如果必须这样做,那么最好的方法是构造一个新的TreeView,它仅显示搜索到的节点及其父节点.
That is not how a tree view normally works - you don''t hide siblings at the same level.
If you must do this, then the best way is to construct a new TreeView which only shows the searched for node, and it''s parents.
这篇关于在C#.net中仅显示搜索树节点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!