What I see in various sources leads me to believe that I can set the column width(s) to -1 or -2 to size the column width(s) to fit the data or the header, respectively. However, when I use those numbers for ColumnWidth the listView control's display is blank.
Of course, it is trivial to write code to do this manually -- I've already done that for column headers -- but it appears that this functionality is built-in and I don't know how to access it.
Code: Select all
ss_columnList( SS ) = ColumnList :-
% To adjust the width of the longest item in the column, set the Width property to -1.
% To autosize to the width of the column heading, set the Width property to -2.
% NOTE: these parameters don't seem to work in VIP 2017-08-13
% https://msdn.microsoft.com/en-us/library/system.windows.forms.columnheader.width.aspx
% https://stackoverflow.com/questions/1257500/c-sharp-listview-column-width-auto
ColumnList = [ C || S in SS,
ColumnWidth = calcColumnWidth(S), % calculates column width to use and adds 2 spaces for padding
% ColumnWidth = lvscw_autoSize, % NOTE: setting width to -1 (lvscw_autoSize) or -2 (lvscw_autoSize_useHeader) to autosize does not work with VIP
C = listViewControl::column( S, ColumnWidth, alignLeft )
].