?
Solved

TListView Problem..

Posted on 1998-08-31
4
Medium Priority
?
160 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 120 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
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…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses
Course of the Month13 days, left to enroll

777 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