treeview - How to find the all parent node of a child node from bottom to top in tree view control using vb.net -
here have below treeview shown in image.
for child node g g
want fetch parent nodes name bottom top , store list. means in list should add g g, f f, d d, b b.
please suggest solution.
thanks in advance...
this code obtain information parents node.
dim selectednode treenode = yourtreeviewselectednode dim nodepath string= "" 'will store full path 'you full path of node 'parent\child\grandchild 'the procedure fill nodepath obtainnodepath(selectednode,nodepath) msgbox(nodepath) private sub obtainnodepath(byval node treenode, byref path string) if node.parent isnot nothing path = io.path.combine(node.text, path) ' parent\child if node.parent.level = 0 exit sub 'call again method check if can extract more info obtainnodepath(node.parent, path) end if end sub
Comments
Post a Comment