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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only