Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Combobox, rowsource 0, columncount 2
Message
From
17/10/2001 13:10:06
 
 
To
17/10/2001 09:53:43
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00569537
Message ID:
00569734
Views:
24
Hi Christian.

>> So the result is odd, showing in the first row an item in the column, in the second row shoing an item in the second column:

THIS.ADDITEM("1", 1, 1)
THIS.ADDITEM("YES", 2, 2) <<

The online help states that the syntax for this command is Control.AddItem(cItem [, nIndex] [, nColumn]). It goes on to say that when you specify the optional nIndex and nColumn parameters, the new item is added to that row and column in the control. If you specify a row that already exists, the new item is inserted at that row and the remaining items are moved down a row. Sounds good! Unfortunately, it doesn't work quite like that.

The AddItem method really adds an entire row to the list. If the list has multiple columns and you use this syntax to add items to each column, the result is not what you would expect. When using the AddItem method to populate a combo or list, add the new item to the first column of each row using the syntax Control.AddItem( 'MyNewValue' ). Assign values to the remaining columns in that row using the syntax Control.List[Control.NewIndex, nColumn] = 'MyOtherNewValue'. The AddListItem method, however, does work as advertised.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform