delphiscrollbarvirtualtreeviewtvirtualstringtree

How to update the VirtualStringTree scrollbars?


i am having hard time to fix my problem on VirtualStringTree.

The problem now was I'm going to change each of the NodeHeight into different size. As a result, the VirtualStringTree did not give me a correct Scrolling, causing the other node cannot be seen.

Could anyone help?


Solution

  • Thats because VT won't know the total height of the tree until all the nodes are initialized (theyr height becomes known). So one option would be to force all nodes to be initialized. Thats of course against the "virtual paradigm" of th VT, but if you have only small number of nodes it's not so bad. Another option is to set the DefaultNodeHeight to maximum NodeHeight you going to use (if you know it beforehand) so VT will assume all the uninitialized nodes to be of that height.