Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Adding a new record in Grid
Message
De
19/10/1998 22:30:11
 
 
À
19/10/1998 16:49:49
David Keene
Ibc Computer Distributors
Kitchener, Ontario, Canada
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00148288
Message ID:
00148361
Vues:
20
>Hi everyone!
>I'm trying to get a grid to create a new record when a user clicks on a blank space in the grid. I already have a NewItem function to call (which is called from a button to 'add item'). I'm trying to make it a little more intuitive.
>
>Any suggestions are apreciated.
>
>Regards,
>Dave

I´m using this:
- In the rigthmost column of the grid I put a command button with a downarrow icon (this makes the thing intuitive)

- In the click event of the button, put the following code:
THIS.PARENT.PARENT.ALLOWADDNEW = .T.
KEYBOARD "{DNARROW)"
(This adds a new row and let the cursor on the leftmost column in the new record

- In the control of the first (leftmost) column of the grid, in the when event, put the following code:
THIS.PARENT.PARENT.ALLOWADDNEW = .F.

All the user has to do is go to the last column and click (or ) and he´s on the next record.

the user does not appends blanks by pressing down arrow, but still may create various blank records by clicking continuously on the button.
Rather than worrying about many blank records, I discard them when saving.
There´s a better life... Just it´s more expensive!
Cristóbal Manrique M.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform