Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Adding items to 2nd column of Combo
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00396237
Message ID:
00396241
Views:
13
Hi George.

>> FOR i = 1 to 10
this.Combo1.AddItem(STR(i),i,1)
this.Combo1.AddItem("Colm 2"+STR(i),i,2)
NEXT <<

This is because the combo's AddItem method does not work as advertized. The addItem method actually adds an entire row to its RowSource. So, in order to make it work, you need code like this:
FOR lnItem = 1 TO lnItemCount
  WITH This.Combo1
     .AddItem( 'My Cool New Item' )
     *** This populates column 2 of the newly added row
     .List[ .NewIndex, 2 ] = 'The second cool column'
  ENDWITH
ENDFOR
Otherwise, you will have to use the combo's ListItem (and corresponding AddListItem method) collection. This method works as advertized.

Marcia
Previous
Reply
Map
View

Click here to load this message in the networking platform