Let's assume a grid with 2 columns.
Column1's CurrentControl is a checkbox.
Column2's CurrentControl is a spinner.
The spinner should only be enabled if the checkbox is checked.
The code in the spinner GOTFOCUS method is:
THIS.ENABLED=THIS.PARENT.PARENT.COLUMN1.VALUE, i.e. .T. if the checkbox is checked, otherwise .F.
This works initially to some degree, but as soon as I click on a checkbox it stops working for all spinners in the grid, and no amount of refreshing or what have you will get it back on track.
I have had a similar problem once with calculations (Col3.Txt1.Value=Col2.Txt1.Value * .Col1.Txt1.Value) and solved id by
looping through the Columns and setting the CONTROLSOURCE property in the AFTEROWCOLCHANGE method.
LPARAMETERS nColIndex
FOR i=1 TO THIS.COLUMNCOUNT
THIS.COLUMNS(i).CONTROLSOURCE=THIS.COLUMNS(i).CONTROLSOURCE
ENDFOR
Regards
Peter
Peter Pirker
Whosoever shall not fall by the sword or by famine, shall fall by pestilence, so why bother shaving?
(Woody Allen)