Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Valid and Lostfocus in Grid
Message
From
24/09/1998 11:30:18
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
24/09/1998 07:46:38
Joao Godinho
Fredesenvolv, Lda
Lisbon, Portugal
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00140289
Message ID:
00140395
Views:
25
>Create a form with a grid and one button
>
>in the thisform.grid1.column1.text1.valid method :
> if this.value > 1000
> = messagebox("Incorrect Value")
> return .f.
> endif
> return .t.
>
>in the thisform.grid1.column1.text1.lostfocus method :
> if this.value > 1000
> this.value = 0
> endif
>
>So if you enter 1000 the messagebox appears then you click OK and if you click on the button the thisform.grid1.column1.text1.lostfocus
>won´t be executed.
>
>What´s happening here
>
>I´m working with Vfp 5.0a
>
>Thank you ALL
Hi Joao,
There is a known bug in grid.control.valid and !corrected on VFP6 too as MS knowledgebase says. A controls valid is not fired if you click outside the grid (in fact fired but but acts as not fired and you can go outside of grid). Workaround :
-Create a custom property (form or grid - say form) lHangingValidation
-Control.interactivechange (which has valid code also)
*InteractiveChange
* Your actual validation code here except messagebox etc
thisform.lHangingValidation = (this.value > 1000) 
&& Expression is what valid would return .f.

* Grid.Valid
return thisform.lHangingValidation
Probably you won't need lostfocus then.
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
Reply
Map
View

Click here to load this message in the networking platform