Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Grid Control - Append a new record in the last grid row
Message
De
10/11/1998 14:52:07
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00156026
Message ID:
00156313
Vues:
35
>>>>When there are no records in the grid, you can't get focus into a row, because there are no rows. So you can't down arrow to add a record. You could put >something in grid.click() to add a record if the the cursor is empty...
>>>This is another situation that has the grid screaming for a GotFocus and LostFocus event.
>>
>>Well, you have When and Valid...
>>
>>>I was hoping to test This.ActiveRow in the grid and if 0 APPEND a new record but can't determine where. I can't use .Click because the functionality has to be there when TABbing into the grid as well.
>>
>>'When' fires whether or not there are records in the grid. This would be a good plave to test for activerow and append a record if needed.
>
>I thought of this to but during .When the grid doesn't have focus yet so .ActiveRow always returns 0
>
>>
>>>I've ended up using the COUNT... function in the grids .When event and in my >custom Form.DeleteRec event. If 0 then I APPEND.
>>
>>Be careful with COUNT, it moves the record pointer. For many apps this is annoying if not dangerous...
>
>Like I said, I'm not totally happy with this approach but it's all I can come up with for now and because I'm deleting records I can't use RECCOUNT so basically I do the following:
>
>ThisForm.LockScreen=.T.   prevents the visual annoyance
>mnrec=RECNO()
>COUNT......
>GOTO mnrec
>ThisForm.LockScreen=.F
>
.
>
>Thanks for all the ideas.

how about

IF RECCOUNT(THIS.RecordSource) = 0
Erik Moore
Clientelligence
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform