Solved

How to fill my TListview with data coming from edits?

Posted on 2006-11-15
3
178 Views
Last Modified: 2010-04-05
Hi Folks,

Another one for ya >

How can I fill my TListview (three columns) with the text from 2 edits and 1 combobox?

Kind regards,

Paul


lv.Items.Item[i].caption := AddForm.edtOmschrijving.Text;
lv.Items.Item[0].SubItems[1]:= AddForm.cboSchakelopties.Text;
the third column being ?



0
Comment
Question by:PeterdeB
  • 2
3 Comments
 
LVL 28

Accepted Solution

by:
ciuly earned 500 total points
ID: 17946562
that depends on your listview style. since you mention 3 columns I suspect it's a vsreport. in this case
for row X
column1 is lv.Items.Item[x].caption
column2 is lv.Items.Item[x].subitems[0]
column3 is lv.Items.Item[x].subitems[1]

so in your case that would translate to:
with lv.Items.add do
begin
  caption := AddForm.edtOmschrijving.Text;
  SubItems.add(AddForm.cboSchakelopties.Text);
  SubItems.add( AddForm.thecombobox.text);
end;
0
 

Author Comment

by:PeterdeB
ID: 17947316
Hi Ciuly!

First of all thanks for you reply!

I can't get it working with three columsn...I must be overlooking somehting but I have no idea as to what that might be....

procedure TForm1.Button1Click(Sender: TObject);
begin
   AddForm.Startup;
  if (AddForm.ShowModal = mrOK) then
  begin
      with lv.Items.add do
begin
  caption := AddForm.edtOmschrijving.Text;
  SubItems.add(AddForm.edtEntry.Text);
  SubItems.add( 'blah');
end;

This fills the first two columns....regardless of what I put into the second SubItems.Add

kind regards,

Paul
0
 

Author Comment

by:PeterdeB
ID: 17947335
Geeeez....a little embarassed here....I see what I have been dong now....silly me ;-) In the object inspector....I defined two columns stead of three!

Kind regards,

Paul
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
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…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

747 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now