>I'm trying to create a 2 column listbox from the listbox's container's INIT method with the following code:
>
> SELECT lvesin
> n=1
> SCAN
> This.LstSource.AddItem(lvesin.dispval,n,1)
> This.LstSource.AddItem(lvesin.codeno,n,2)
> n=n+1
> ENDSCAN
>
>I'm using the "n" to indicate the nIndex value in the ADDITEM statement. The listbox comes up with first no dispval in column 1, but all my codeno's in column2, then all dispval's in column1 and no codeno's in column2.
>
>Now:
>
| 001
> | 002
> | 003
>apples |
>bananas |
>oranges |
>
>Instead of:
>apples | 001
>bananas | 002
>oranges | 003
>
>What am I doing wrong?
>
>Mandy
Hi Mandy,
To add to what Edward said, what I have usually done is use AddItem() to add the the first ( column1 ) item, then use AddListItem() to add in the other columns' data. And, I haven't played with it a lot, but I believe it's necessary to do it this way.
Bill
William A. Caton III
Software Engineer
MAXIMUS
Atlanta, Ga.