Reputation: 271
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?
Upvotes: 3
Views: 2603
Reputation: 821
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.
Upvotes: 12