>>>>>I can dynamically disable all rows in a grid leaving only the
>>>>>current row enabled (after an append). However the user can still
>>>>>move the record pointer to another row by clicking. How can I
>>>>>prevent this ?
>>>>>
>>>>>Regards Ian
>>>>
>>>>Try BeforeRowColChange Event on the Grid
>>>>
>>>>Cheers
>>>
>>>I've been experimenting with this event, but still can't get the
>>>code within it from changing the recotd pointer ...
>>>
>>>Regards Ian
>>Ian,
>>This code is part of an brcc code from a class :
LPARAMETERS nColIndex
>>llChangingRow = .f.
>>with this
>> if lastkey() = 145
>> .nLastValidRec = .nCurrec
>> endif
>> thisform.LockScreen = .lInGrid
>> if mdown()
>> lnBottom = .top+.headerheight+.relativerow * .rowheight
>> lnTop = lnBottom - this.rowheight
>> lnMouseRowPos = mrow(wontop(),3)
>> lnMouseColPos = mcol(wontop(),3)
>> llChangingRow = !(between(lnMouseRowPos,lnTop, lnBottom) ;
>> and between(lnMouseColPos,.left,.left+.width))
>> else
>> llChangingRow = inlist(lastkey(),24,5,18,3,145,148)
>> endif
>> * Some keys in list are class specific
>> if llChangingRow
>> * Your code here
>> * nodefault prevents movement
>> endif
>>endwith
If you're doing it for newly appended recs and doing tableupdate per row then just checking recno()<0 could be enough too.
>>Cetin
>
>Cetin,
>Does NODEFAULT in BeforeRowColChange not lock BOTH row/column (of whatever
>row) ?
>
>Regards Ian
Yes Ian,
Nodefault prevents movement from current cell. But in code a check is done to see if it's a row change (unless new key assignments are done for changing rows). BTW lInGrid is also class specific.
This brcc code however doesn't prevent you from leaving grid and that's supported with grid.valid. I would email the class itself but since yesterday I have big problems with my mail server (this is the only gateway for me now for the rest of world :)
Cetin