>On my form I have a grid and a command button.
>In the grid there is a textbox.
>In the textbox's valid event I return .f. under certain circumstances to force valid entry. This works fine if the user attempts to move around within the grid; however, if the user clicks on the command button outside of the grid, the command button gets the focus even though the textbox's valid returns false (and even though the textbox's lostfocus never gets called).
>Is there anyway for control inside a grid to keep the focus regardless of where the user clicks?
Joel,
It's an MS confirmed bug. Workaround is to use grid.valid :
if ....
this.parent.parent.lHangingValidation = .t.
else
this.parent.parent.lHangingValidation = .f.
endif
return !this.parent.parent.lHangingValidation
if ....
return .f.
else
return !this.lHangingValidation
endif
If setting of lHangingValidation is done in InterActiveChange instead of valid of control then it's more stable.
Cetin