Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Movement in Grid
Message
De
04/01/2002 20:31:59
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00601028
Message ID:
00601080
Vues:
16
Nick,

Sorry....I was so excited about getting it to work past what was visible in the grid that I didn't check that. However, when I rechecked my test grid I did not get the same behavior with the TAB as you experienced ????? Try this modified code. Does it look better to you at runtime? Stuffing the keyboard always showed me the cursor jumping around (to the beginning of the row then down). This looks like it immediately goes to the first column in the next row.

LPARAMETERS nColIndex

nBrow=thisform.grid1.RelativeRow

IF nColIndex=this.ColumnCount AND INLIST(LASTKEY(),4,9,13) && rightarrow, tab, enter

thisform.grid1.ActivateCell(thisform.grid1.RelativeRow+1,1)
NODEFAULT
nNrow=thisform.grid1.RelativeRow

IF nBrow=nNrow
thisform.grid1.DoScroll(1)
nBrow=thisform.grid1.RelativeRow &&NEW
thisform.grid1.ActivateCell(thisform.grid1.RelativeRow+1,1)
NODEFAULT
nNrow=thisform.grid1.RelativeRow &&NEW
IF nBrow=nNrow &&NEW
thisform.grid1.ActivateCell(thisform.grid1.RelativeRow,1) &&NEW
NODEFAULT &&NEW
ENDIF &&NEW
ENDIF

ENDIF

>>Nick,
>>
>>RE: Moving from last column in this row to first column in next row
>>
>>I've continued to think about your original problem. The solution presented does what you wanted and you may not want to go into it any further. But, I was curious as to "how" to get the activatecell method to work. The code below represents what I've found. I think it does everything you want. Visually I think it looks better at runtime. Let me know what you think.
>>
>>
>>*In BeforeRowColChange
>>LPARAMETERS nColIndex
>>
>>nBrow=thisform.grid1.RelativeRow
>>
>>IF nColIndex=this.ColumnCount AND INLIST(LASTKEY(),4,9,13)
>>
>> thisform.grid1.ActivateCell(thisform.grid1.RelativeRow+1,1)
>> NODEFAULT
>> nNrow=thisform.grid1.RelativeRow
>>
>> IF nBrow=nNrow
>> thisform.grid1.DoScroll(1)
>> thisform.grid1.ActivateCell(thisform.grid1.RelativeRow+1,1)
>> NODEFAULT
>> ENDIF
>>
>>ENDIF
>>
>>*Greg
>
>
>Hi Greg, I tried the new code (clever trick) and it works fine except that once it gets to the end of the last row and column, if keep hitting tab, it scolls the grid up. However, it won't let you click into another cell on the grid because it locked on the last row. If you hit shift tab to go back one cell then you are able to click anywhere in the grid again.
>
>Thanks
>Nick Patel
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform