Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Grid jumping
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Titre:
Divers
Thread ID:
00382139
Message ID:
00382162
Vues:
16
>>I have a VFP6 grid for lines on an order. I have a button to click to add a new line to the order. The first click adds a line to the order and puts the user on the grid line to enter the data. When the "add line" button is clicked for subsequent lines, the line is shown on the grid under the previous line. The user can enter the data in the first column but when leaving that column, the grid jumps to whatever line is at the top of the grid on the screen at the time: i.e if they are on line 20 and 5 lines show at a time, it bumps them up to line 16 but puts them in the correct column.
>
>Not sure what's happening, but that doesn't normally occur if no events are called. Is there any code at all in the grid textbox valid/lostfocus/keypress? Or in the grid After/Before-rowcolchange, for example? Is a grid.refresh called somewhere, maybe? Also, is there an index set?


Bruce,

In the DE, the order header file is linked to the order line file by order #. I have a filter on the order line file for ordmast.ordno = ordline.ordno and ordline.complete <> 'Y'. One-to-many property is false (seems to work best for some reason). Index on ordline table is ordno + lineno. Index on ordmast table is ordno. There is code on the textbox of the 1st column but it just puts up a message if they don't enter a valid character (valid, interactivechange). There's a gotFocus on the column that jumps when it receives focus but that code is a one-liner that just sets a variable. No grid code other than refresh. The grid.refresh code is:

LOCAL lcAlias
lcAlias = ALIAS()
SELECT OrdLine
IF !BOF() .AND. !THISFORM.cPicBtns1.EditMode
GO TOP
ENDIF
SELECT (lcAlias)

The go top code is to put the grid at the top line if not editing so the user can see the top of the order. I've commented this out and it doesn't have an effect. I am leaning towards a problem with the way the filter and DE are set up.

Thanks for your help

Sally
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform