Discussion:
Adding rows with multiple columns to listbox
Peter Desjardins
2004-01-12 16:39:10 UTC
Permalink
Hi everyone,

This must be easy but I can't find how to do it.
I want to programatically add rows with multiple columns to a listbox.

This works for a single column:
ListBox1.addrow "Hello"

This does not work for two columns:
ListBox1.addrow "Hello","World"

What is the correct syntax?
Thanks for any help with this.

Regards,

Peter Desjardins


- - -
Unsubscribe or switch delivery mode:
<http://support.realsoftware.com/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>
Joseph J. Strout
2004-01-12 16:47:59 UTC
Permalink
Post by Peter Desjardins
I want to programatically add rows with multiple columns to a listbox.
You call AddRow, which creates a new row and fills in the data for
column 0. Then you use the Cell(row,col) accessor to stuff data into
the other columns.
Post by Peter Desjardins
ListBox1.addrow "Hello","World"
Hmm, in RB 5.5 the language could actually support something like
that. Feel free to file a feature request.

Cheers,
- Joe
--
,------------------------------------------------------------------.
| Joseph J. Strout REAL Software, Inc. |
| joe-***@public.gmane.org http://www.realsoftware.com |
`------------------------------------------------------------------'

- - -
Unsubscribe or switch delivery mode:
<http://support.realsoftware.com/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>
Brad Rhine
2004-01-12 17:04:56 UTC
Permalink
Post by Joseph J. Strout
Hmm, in RB 5.5 the language could actually support something like
that. Feel free to file a feature request.
And let us know what the ID is so we can sign on. That would be pretty
cool.

--
brad-96Ul9/***@public.gmane.org
http://truetech.org
<><


- - -
Unsubscribe or switch delivery mode:
<http://support.realsoftware.com/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>
Norman Palardy
2004-01-12 17:15:49 UTC
Permalink
There already is one

http://support.realsoftware.com/feedback/viewreport.php?
reportid=dqbmbnpj
Post by Brad Rhine
Post by Joseph J. Strout
Hmm, in RB 5.5 the language could actually support something like
that. Feel free to file a feature request.
And let us know what the ID is so we can sign on. That would be pretty
cool.
- - -
Unsubscribe or switch delivery mode:
<http://support.realsoftware.com/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>
Brad Rhine
2004-01-12 17:27:36 UTC
Permalink
Post by Norman Palardy
There already is one
http://support.realsoftware.com/feedback/viewreport.php?
reportid=dqbmbnpj
Thanks!

--
brad-96Ul9/***@public.gmane.org
http://truetech.org
<><


- - -
Unsubscribe or switch delivery mode:
<http://support.realsoftware.com/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>
Norman Palardy
2004-01-12 16:46:09 UTC
Permalink
Post by Peter Desjardins
Hi everyone,
This must be easy but I can't find how to do it.
I want to programatically add rows with multiple columns to a listbox.
ListBox1.addrow "Hello"
ListBox1.addrow "Hello","World"
What is the correct syntax?
Thanks for any help with this.
Listbox.addrow really only adds to the first cell in the row,
regardless of the number of columns


ListBox1.addrow "Hello"
listbox1.cell(listbox1.lastindex,1) = "World"


- - -
Unsubscribe or switch delivery mode:
<http://support.realsoftware.com/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>
Ricardo Rojas
2004-01-12 16:52:02 UTC
Permalink
Post by Peter Desjardins
ListBox1.addrow "Hello","World"
Try
listBox1.addrow "Hello"
listBox1.cell(listBox1.lastIndex,1)= "World"

hth,
Post by Peter Desjardins
®<<
- - -
Unsubscribe or switch delivery mode:
<http://support.realsoftware.com/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>
Peter Desjardins
2004-01-12 17:12:00 UTC
Permalink
Thanks everyone for the quick replies.

Have a good day.

Peter


- - -
Unsubscribe or switch delivery mode:
<http://support.realsoftware.com/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>
Emile Schwarz
2004-01-13 08:56:11 UTC
Permalink
Hi all,

a better one for multi-columns ?

Dim Row As Integer

ListBox1.Addrow "Hello"
Row = ListBox1.LastIndex
ListBox1.Cell(Row,1) = "beautiful"
ListBox1.Cell(Row,2) = "Rosanna,"
ListBox1.Cell(Row,3) = "Jeanie,"
ListBox1.Cell(Row,4) = "and ..."
ListBox1.Cell(Row,5) = "John" // 2 girls and one boy !

It seems short and clear for me ;)

Cheers,

Emil
REALbasic-NUG Digest #9872 - Monday, January 12, 2004
Post by Peter Desjardins
ListBox1.addrow "Hello","World"
listBox1.addrow "Hello"
listBox1.cell(listBox1.lastIndex,1)= "World"
- - -
Unsubscribe or switch delivery mode:
<http://support.realsoftware.com/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Loading...