I'm familiar with the way how to put combo control into Grid's column but I don't know how to achieve that this combo show as its value the values from tables field in which column is situated. For example, in some able there is field how much times customers replaced some articles: Never, 1st time,2nd time,3rd time,more than 3 times. I created Combo with these values but I'm unable to "tell to the Grid" to change Combo's value to proper value based on field value. I tried to put fields with complaints quantity as column in Grid and to read it and then change Combo's state but doesn't work.
Is there some special moment where I need to put some IF checking but on what basis?
Thank you
There is no good nor evil, just decisions and consequences.
Is there some special moment where I need to put some IF checking but on what basis?
Code:
*combo in grid u 6. column
.Column6.header1.caption="No. of returns"
.Column6.ControlSource = "complains.pt_howmany"
.Column6.AddObject("othControl","combobox")
.Column6.CurrentControl = "othControl"
.Column6.Width=70
.Column6.othControl.AddItem("1nd time")
.Column6.othControl.AddItem("2nd time")
.Column6.othControl.AddItem("3rd time")
.Column6.othControl.AddItem("more than 3 times")
.Column6.othControl.AddItem("Never")
.Column6.othControl.Listindex=1
.Column6.Sparse = .F.
.column6.visible=.t.
... *inside programmatically designed grid set up Combo state:
do case
case ALLTRIM(thisform.grid1.column5.text1.value)>3
thisform.grid1.Column6.othControl.Listindex=3
...
*end of design grid
There is no good nor evil, just decisions and consequences.