General information
Category:
Forms & Form designer
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
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