[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

How to fill my TListview with data coming from edits?

Posted on 2006-11-15
3
Medium Priority
?
185 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
[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 28

Accepted Solution

by:
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
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

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

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…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

650 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