Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Dedecting grid row change in beforerowcolchange event
Message
From
21/09/1998 13:54:50
 
 
To
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Dedecting grid row change in beforerowcolchange event
Miscellaneous
Thread ID:
00139150
Message ID:
00139150
Views:
69
Is it possible to dedect grid row change in beforerowcolchange event using this code by Cetin:

> For record level validation this is my grid class beforerowcolchange

> *beforerowcolchange
> LPARAMETERS nColIndex
> thisform.LockScreen = this.lInGrid && Related with highlight
> llChangingRow = .f.
> with this
> if mdown()
> lnBottom = .top+.headerheight+ .relativerow * .rowheight
> lnTop = lnBottom - this.rowheight
> lnMouseRowPos = mrow(wontop(),3)
> llChangingRow = !between(lnMouseRowPos,lnTop, lnBottom)
> else
> llChangingRow = inlist(lastkey(),24,5,18,3,145)
> endif
>endwith
>if llChangingRow ;
> and !empty(dbgetprop(this.recordsource,"Table","RuleExpression")) ;
> and !evaluate( dbgetprop(this.recordsource,"Table","RuleExpression"))
> nodefault
> this.WarnMessage()
> else
> * Escape
> if lastkey() = 27 ;
> and !empty(dbgetprop(this.recordsource,"Table","RuleExpression")) ;
> and !evaluate(dbgetprop(this.recordsource,"Table","RuleExpression"))
> =tablerevert(.f.,this.recordsource)
> endif
>endif

How to handle the following case:

1. During row editing, user activates some other window: this is required.
2. After that, it rapidly clicks in some other row in the editing window.

This causes a number of events to occur: other window lostfocus(), deactivate(),
editing window activate() and at last, your grid beforerowcolchange() event

However, your beforerowcolchange event does NOT dedect row change in this
case because mouse button may be already released at this moment !!!

How to avoid this situation?
Andrus
Next
Reply
Map
View

Click here to load this message in the networking platform