Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Locking current grid row
Message
De
30/10/1998 10:20:05
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
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:
00152805
Vues:
25
>>>>>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
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
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform