Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Please Help !!! Valid Method ???
Message
From
01/09/1998 03:34:30
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
01/09/1998 03:28:22
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00131529
Message ID:
00131807
Views:
24
>>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.
* Custom grid or form property lHangingValidation (Grid preferred)
>* 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 :
* Custom grid property lHangingValidation
* A valid.event of textbox
if ....
  this.parent.parent.lHangingValidation = .t.
else
  this.parent.parent.lHangingValidation = .f.
endif
return !this.parent.parent.lHangingValidation

* Grid.valid
if ....
   return .f.
else
   return !this.lHangingValidation
endif
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform