Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Listbox in a grid
Message
From
05/03/1999 06:49:58
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Listbox in a grid
Miscellaneous
Thread ID:
00194371
Message ID:
00194371
Views:
54
I want to add a dropdown combobox to a grid of a table that lists the possible choices in the related table. I need to do this at runtime. The grid table is "Wire" and the table that holds the possible choices is "Rod". I need to display the data from the Wire table but only allow the user to select a choice from the Rod table.

In the init of the grid I have the following code which allows me to find the column I want then modify it. At least that part works!

LOCAL lnColCnt, lnCnt
lnColCnt = This.ColumnCount
lnCnt = 1
FOR lnCnt = 1 to lnColCnt
IF This.Columns(lnCnt).ControlSource = "rodid"
This.Columns(lnCnt).AddObject("cboRodId", "COMBOBOX")
This.Columns(lnCnt).cboRodId.Visible = .T.
This.Columns(lnCnt).Sparse = .F.
ENDIF
ENDFOR

The combo box does not show up.

How do I set the data in the combo box to only allow a choice from the second table?

Thanks
Next
Reply
Map
View

Click here to load this message in the networking platform