Information générale
Catégorie:
Gestionnaire d'écran & Écrans
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
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement