Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Locking current grid row
Message
From
30/10/1998 10:13:51
 
 
To
30/10/1998 06:26:54
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00152154
Message ID:
00152800
Views:
28
>>>>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 && Adding new rec - class specific
>	.nLastValidRec = .nCurrec && Class specific
>  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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform