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