How to hide TVirtualStringTree node?

if I am not mistaken, it is impossible to have invisible nodes in the TVirtualStringTree treeview, since there are no allowed, visible or other properties for this. Am I right about that?

If so, how did I manage to get an invisible node?

The structure of my tree:

One Node Another node Subnode 1 Subnode 2 ... Subnode 15 Subnode 16 [which is not visible!] Yet another node Subnode 1 from yet another node Subnode 2 from yet another node 

I can find Subnode 16 when I do the FirstNode / GetNextNode loop over the whole tree and let me print the text for the first column. I can also inspect the node and see that it got the previous sibling, but there is no next sibling, for example, and the height of the node is 18.

So how did I do this?

Hello

Marcus

+4
source share
2 answers

If I am not mistaken, it is impossible to see invisible nodes in the TVirtualStringTree tree, since there are no active, visible or other properties for this. Am I right about that?

You are mistaken, it is possible to have both invisible and disconnected nodes. To switch the visible state of a node, use

 vtree.IsVisible[Node] := boolean; 

to enable / disable node use

 vtree.IsDisabled[Node] := boolean; 

You can also initialize node disconnected state in the tree OnInitNode event by adding the ivsDisabled to InitialStates .

+21
source

In addition to ains answer, you can use the following functions for tree recursion:

To restart ALL nodes

 Tree.GetFirst(); Tree.GetNext(); Tree.GetPrevious(); 

To recombine only VISIBLE nodes:

 Tree.GetFirstVisible(); Tree.GetNextVisible(); Tree.GetPreviousVisible(); 
+1
source

All Articles