Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Blank records in grids
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00168033
Message ID:
00168081
Vues:
23
>I have a grid in a form. There is an add button.
>When a user clicks on add, I append a blank record and then disable
>the add button and enable the save and cancel buttons. I do not
>want the user to move off of the blank record. At this time they
>can. How can I keep the focus on the blank record until they click
>the cancel button or add some text to the record?
>
>Thanks,
>
>Steve Wilson
One way is to add a form property lEmptyRecordInGrid. In the refresh method of every control that you don't want used when there is a blank record, put This.Enabled = ! Thisform.lEmptyRecordInGrid

Set the property to true in your code that appends a blank record and refresh all the controls.

In the grid's Valid method, if Thisform.lEmptyRecordInGrid is true, scan the grid's record source. If there are not empty records, set the property to false and refresht the controls again.

To be really OOP, add a method to the form called SetEmptyRecordInGrid. This method should set the switch and handle the refreshing of controls.
----------
Mark Bucciarelli
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform