How to hide a specific column in a virtual string tree?
-
26-05-2021 - |
Question
How can I hide specific columns in my virtual string tree?
I've tried this code:
Header.Columns.Items[3].Width := -1;
It displays the column, but not the header caption. Why?
Solution
To hide a column, eliminate coVisible from the TVTColumnOption enumeration, e.g.,
if coVisible in VST.Header.Columns[3].Options then
VST.Header.Columns[3].Options := VST.Header.Columns[3].Options - [coVisible];
The TVirtualTreeColumn class has a MinWidth property that would override any column width less than MinWidth. I'm not in a position right now to check this, but I don't think MinWidth will even accept a negative integer value.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow