How to fill my TListview with data coming from edits?

Posted on 2006-11-15
Medium Priority
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,


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

Question by:PeterdeB
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
LVL 28

Accepted Solution

2266180 earned 2000 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
  caption := AddForm.edtOmschrijving.Text;
  SubItems.add( AddForm.thecombobox.text);

Author Comment

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);
  if (AddForm.ShowModal = mrOK) then
      with lv.Items.add do
  caption := AddForm.edtOmschrijving.Text;
  SubItems.add( 'blah');

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

kind regards,


Author Comment

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,


Featured Post

Technology Partners: 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

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
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…
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 …
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses

765 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