Solved

Getting ListView to work.

Posted on 1998-07-30
1
151 Views
Last Modified: 2010-04-04
Could someone please post an example of how to get the ListView component to work. I have it setup for a report view with 2 columns. I just can't seem to get it too add items and sub items. I'm using version 3.0.
Thanks
0
Comment
Question by:LostOne
[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
1 Comment
 
LVL 5

Accepted Solution

by:
JimBob091197 earned 100 total points
ID: 1359289
Hi

Have you set up your listview's columns?  This is an example which adds 2 columns, then some data to a listview.  (My listview is called lvTest.)

  // Set the view style.
  lvTest.ViewStyle := vsReport;

  // Add some columns.
  with lvTest.Columns.Add do
    begin
      Caption := 'First Column';
      Width := 100;
    end;
  with lvTest.Columns.Add do
    begin
      Caption := 'Second Column';
      Width := 100;
    end;

  // Add some items.
  with lvTest.Items.Add do
    begin
      Caption := 'First Caption';
      SubItems.Add('This is in 2nd col.');
    end;
  with lvTest.Items.Add do
    begin
      Caption := 'Second Caption';
      SubItems.Add('This is in 2nd col.');
    end;

Cheers,
JB
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Convert a string into a TDateTime 5 81
Convert MS Word document to a PDF file 9 138
enhance the following code 3 54
Slow Restore if incremental backups using RDiff.exe 4 52
A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

710 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