Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Locking current grid row
Message
De
30/10/1998 10:17:14
 
 
À
30/10/1998 10:13:51
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00152154
Message ID:
00152803
Vues:
20
>>>>>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

Sorry substitute BOTH for CURRENT (active) row/column

Regards Ian
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform