Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to populate multicolumn combobox

Status
Not open for further replies.

mensud

Programmer
Jul 22, 2001
51
0
0
US
I need to populate a two-column combobox. I am using AddItem method, but I get an empty items in both columns.
How to populate multicolumn combo box anuway?

Thanks.
Mensud
 
I don't have a 2 or more element combo box handy, but take a look at my FAQ on listboxes. To get the 2nd item it requires a addlistitem instead of add item. I suspect it is the same concept with a combo box.

Programmatically Loading & Referencing Listbox Items
faq184-4322

Jim Osieczonek
Delta Business Group, LLC
 
Hello Mensud.

Try code like thisin the combo box's Init()

Code:
WITH This
  .BoundColumn = 2
  .BoundTo = .T.
  .AddItem( "Apples" )
  .List[ .NewIndex, 2 ] = 1
  .AddItem( "Oranges" )
  .List[ .NewIndex, 2 ] = 2
  .AddItem( "Bananas" )
  .List[ .NewIndex, 2 ] = 3
ENDWITH


Marcia G. Akins
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top