Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Record level valid in a grid
Message
From
13/07/1998 09:27:24
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Record level valid in a grid
Miscellaneous
Thread ID:
00116749
Message ID:
00116749
Views:
55
Below is BeforeRowColChange of my grid class. It prevents leaving the row if not table validation is satisfied. So far so good. Problem :
-Table is buffered
-Say table valid expression is !empty(company)
-User is on company field
-Selects all and presses Del
-Presses up arrow
-At this point table valid is satisfied with oldval() (also eval(...rulexpression)) so cannot be catched and VFP message kicks in.
Any suggestion to fix this up ?
do case
	case mdown()
		nBottom = this.relativerow * this.rowheight
		nTop = nBottom -  this.rowheight
		nMouseRowPos = mrow(wontop(),3)
		if !between(nMouseRowPos,;
			this.top+this.headerheight+nTop,;
			this.top+this.headerheight+nBottom) ;
			and !empty(dbgetprop(this.recordsource,"Table","RuleExpression")) ;
			and !evaluate(dbgetprop(this.recordsource,"Table","RuleExpression"))
			nodefault
			this.WarnMessage()
		endif
	case inlist(lastkey(),24,5,18,3,145) ;
		and !empty(dbgetprop(this.recordsource,"Table","RuleExpression")) ;
		and !evaluate(dbgetprop(this.recordsource,"Table","RuleExpression"))
		this.WarnMessage()
		nodefault
	case lastkey() = 27 ;
		and !empty(dbgetprop(this.recordsource,"Table","RuleExpression")) ;
		and !evaluate(dbgetprop(this.recordsource,"Table","RuleExpression"))
		=tablerevert(.f.)
endcase
MTIA.
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
Next
Reply
Map
View

Click here to load this message in the networking platform