>>Do you know why when you return .F. within a valid method of textbox in a grid it lose the focus anyway if you click on another object.
>>
>>Note: the Textbox control work fine if it's not in a grid
>>
>>All idea or suggestion will appreciate
>>Thank's in advance
>Hi Rock,
>As Ken pointed out it's documented in
BUG: Focus Changes Even Though Grid Text Box Valid Returns .F. with no workaround. I commented there a workaround but think it'll never appear there (huh just 255 chars limited commenting).
>Workaround consists of flagging hanging validations and grid.valid checking it.
>* A valid.event of textbox
>if ....
> lHangingValidation = .t.
>else
> lHangingValidation = .f.
>endif
>return !lHangingValidation
>
>* Grid.valid
>if ....
> return .f.
>else
> return !lHangingValidation
>endif
Cetin
Ooops. Rock I forgot to add thisform, this.parent.parent and this depending on where lHangingValidation property belongs. With "lHangingValidation" is a property of grid :
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
Cetin