Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

TListView - TListColumn - Autosize Problem

Status
Not open for further replies.

GHolden

Programmer
May 28, 2002
852
GB
Hi,

I have a ListView that I am adding columns to using...

Code:
  for i := 0 to ADataSource.DataSet.FieldCount - 1 do
  begin
    ListColumn := lvSchemes.Columns.Add;
    ListColumn.AutoSize := True;
    ListColumn.Caption := ADataSource.DataSet.Fields[i].FieldName;
  end;

NB. ListColumn is a variable of type TListColumn

My understanding of AutoSize (I am fairly new to Delphi) is that this should make the column resize to the width of the text in the column. This is not the case. I'm not sure if I need to refresh the columns in some way.

If anyone can shed some light on this for me it would be much appreciated.





There are two ways to write error-free programs; only the third one works.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top