Hi all.
I have a form with a grid, linked to a table. I want to create some combobox at runtime, because the combo can be on one of the 12 column, and it's never the same column. So, I have put some code in the INIT of the grid to add the combo and populate it ;
WITH THIS
.Column5.ControlSource = "fac_hd01.id_inv_po"
.Column5.AddObject("othControl","combobox")
.Column5.CurrentControl = "othControl"
.Column5.othControl.AddItem("Comm. future")
.Column5.othControl.AddItem("Comm. du client")
.Column5.othControl.AddItem("Facture")
.Column5.othControl.AddItem("Note de crédit")
.Column5.othControl.AddItem("Informations")
.Column5.othControl.AddItem("Retours")
.Column5.othControl.AddItem("Echantillons")
.Column5.othControl.AddItem("Comm. Ouverte")
.Column5.Sparse = .F.
ENDWITH
I received no error, but the column with the combo appears grayed. If I drop a combo control in the form, everything is working fine, but I don't want to put a control for each column, just in case...
I search in thread for this problem, but did not find anything. Working with VFP 9.0 Sp2
Thanks in advance.
Nro
I have a form with a grid, linked to a table. I want to create some combobox at runtime, because the combo can be on one of the 12 column, and it's never the same column. So, I have put some code in the INIT of the grid to add the combo and populate it ;
WITH THIS
.Column5.ControlSource = "fac_hd01.id_inv_po"
.Column5.AddObject("othControl","combobox")
.Column5.CurrentControl = "othControl"
.Column5.othControl.AddItem("Comm. future")
.Column5.othControl.AddItem("Comm. du client")
.Column5.othControl.AddItem("Facture")
.Column5.othControl.AddItem("Note de crédit")
.Column5.othControl.AddItem("Informations")
.Column5.othControl.AddItem("Retours")
.Column5.othControl.AddItem("Echantillons")
.Column5.othControl.AddItem("Comm. Ouverte")
.Column5.Sparse = .F.
ENDWITH
I received no error, but the column with the combo appears grayed. If I drop a combo control in the form, everything is working fine, but I don't want to put a control for each column, just in case...
I search in thread for this problem, but did not find anything. Working with VFP 9.0 Sp2
Thanks in advance.
Nro