Link to home
Start Free TrialLog in
Avatar of brainware
brainware

asked on

TListView Problem..

Problem is that it pushed url to 2th line whatever i try..

Procedure TMainForm.DisplayFileList;
Var  NewItem : TListItems;  I : LongInt;
Begin
  NewItem := FilesLV.Items;

  FilesLV.Columns.Add.Caption := 'FileName';
  FilesLV.Columns.Add.Caption := 'URL';
  FilesLV.Columns.Add.Caption := 'Desc';
  FilesLV.Columns.Add.Caption := 'Size Kb';
 for I := 0 to TItems_Count-1 do
  Begin
   NewItem.Add.Caption := TItems[I].FileName;
   // Need to add  TItems[i].URL;
   // Need to add  TItems[i].Desc;
End;End;

ASKER CERTIFIED SOLUTION
Avatar of itamar
itamar

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of brainware
brainware

ASKER

Could u be kind and show me that as code.. im not 100% good at english :)
Ok brainware,

just give me sometime. I´m a little busy right now...
Hi brainware,

as promised, this is an example:


procedure TForm1.Button1Click(Sender: TObject);
var
  NewItem: TListItem;
begin
  NewItem := ListView1.Items.Add;
  NewItem.Caption := 'your file name';
  NewItem.SubItems.Add('your url');
  NewItem.SubItems.Add('your description');
  NewItem.SubItems.Add('your file size');
end;

Don´t forget to set the columns in the Object inspector (Columns property).
It´s not necessary to do it in the code.

Any doubts place a question with the subject "To: Itamar"

IHTH