Solved

TListView Problem..

Posted on 1998-08-31
4
157 Views
Last Modified: 2010-04-04
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;

0
Comment
Question by:brainware
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 4

Accepted Solution

by:
itamar earned 30 total points
ID: 1338293
Hi brainware,

it's me again !

It seems that your trying to make a columned list, right ?

Well, in this case only the "caption" property refers to the first column of an item.
For the others column you have to add subitems of the NewItem added.

To set the columns headers, use the Object Inspector in the Columns... property.

IHTH
0
 
LVL 2

Author Comment

by:brainware
ID: 1338294
Could u be kind and show me that as code.. im not 100% good at english :)
0
 
LVL 4

Expert Comment

by:itamar
ID: 1338295
Ok brainware,

just give me sometime. I´m a little busy right now...
0
 
LVL 4

Expert Comment

by:itamar
ID: 1338296
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
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Dev Express grid collapse 2 48
select query - oracle 16 101
How to remove Recent Projects from Embarcadero C++ builder XE10. Berlin 2 79
Microsoft Access 97 and Delphi XE2 9 74
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question