My friend is working in Delphi with VirtualTreeView and has next problem: He has two columns with data and childs for every row in first column. Is that possible not changing first column width to set maximum child column width?
Legend:
- Circles are nodes
- rectangles are text (black rectangles of root nodes are two column)
How it looks now - look child black reactangle. How it have to be - look red rectangle.
This is called column spanning and yes, it can be done quite easily - just set the
TreeOptions -> AutoOptions -> toAutoSpanColumns
option toTrue
. The way it works is that if the adjacent column is empty then the caption of the current one is extended into it. As you only want it to work for child columns you have to implementOnGetCellIsEmpty
event and returnIsEmpty := True
only for child nodes, ie something like