?
Solved

Beginner... ListView component. Please help...

Posted on 2003-03-20
3
Medium Priority
?
191 Views
Last Modified: 2010-04-04
Okay this question is very basic. VERY basic, actually. But for some reason I am having problems using the ListView component. I'm not sure exactly how to use it.

Lets say I have 3 columns and I want to add integers inside using a for do loop.

For example, lets say I want it to look like...

[Col A][Col B][Col C]
 0      0      0
 1      1      1
 2      2      2
 3      3      3
... etc


i'm not sure how to access the individual columns. Could someone please help?
0
Comment
Question by:PoeticAudio
[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
  • 2
3 Comments
 
LVL 6

Author Comment

by:PoeticAudio
ID: 8177197
That didnt come out exactly right...

the letters are the columns and the numbers are the rows.. like


ABC
---
000
111
222

...etc
0
 
LVL 1

Accepted Solution

by:
SJohnson earned 200 total points
ID: 8177478
ListViews took me a little while to get the hang of, but they are an EXTREMELY useful component.

var
  Root: TListItem;
  Count: Integer;
begin
  ListView1.Items.Clear;
  for Count := 0 to 10 do
    begin
      Root := ListView1.Items.Add;
      Root.Caption := IntToStr(Count); //Column 0

      //The SubItems property is just a TString.
      Root.SubItems.Add(IntToStr(Count));
    end;
end;

You need to create your columns either at design time or runtime.  

Cheers,

Stuart.
0
 
LVL 6

Author Comment

by:PoeticAudio
ID: 8181957
GREAT! Thanks Stuart! -=) I didn't realize it was that easy... as they say... "you da man"

Best Regards,
Steve
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

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…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses
Course of the Month9 days, 9 hours left to enroll

762 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