Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Refreshing form
Message
De
28/04/2009 16:47:25
 
 
À
28/04/2009 15:51:17
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01396794
Message ID:
01396821
Vues:
55
>>Just This....
>>
>>OPEN DATABASE ".\dados\restaurant" shared
>>SELECT codigo,garcom FROM mesas INTO CURSOR openmesas WHERE status = .t.
>>thisform.grid1.RecordSource="openmesas"
>>
>>thisform.grid1.column1.Width= 40
>>thisform.grid1.column2.Width= 110
>>thisform.grid1.column1.text1.Click
>
>When you set grid.recordsource your grid automatically 'rebuilds itself' losing all customization. You may consider doing it differently. Create empty cursor in Form.Load event and assign it as Grid.recordsource in Grid.Init event, assigning all column.controlsources after it. When it is done, use Insert... Select command in Form.Init event keeping grid properties intact:
>
>Insert Into openmesas (garcom) Select gracom From mesas Where status=.T.
>Go Top In openmesas
>This.Grid1.Setfocus
>
I agree that you should move this to the Load(), but you should also not be calling the Init() once you are in the form. It is only called when the form is first instantiated. I use a custom method called RequeryData() which will get data and then copy that data into the cursor which was created in the Load().

HTH!
Carsten M. Thode
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform