10449 : How can I tell which nodes in my tree are visible to the user?

Question

How can I tell which nodes in my tree are visible to the user?

When the user expands a node, I would like to be able to adjust the display so that all the sub-nodes of that node are visible (without the user having to scroll up or down to see them).

Or is there a way of getting the Gant control to adjust the display automatically? I would ideally like the tree to work like the tree in Windows Explorer.

Answer

Both the phGantTimePackage and GTP.NET returns a rectangle of -1,-1,-1,-1 for the grid rect of cells that has not been drawn (because they are not currently on screen).

In phGantTimePackage you can use the IphGantRow3.GetRect method
and in GTP.NET you would use GridNode.Rect

The same applies to individual cells (that they return a -1 rect if not currently on screen).

Leave a Reply