Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Grid refreshing
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Titre:
Divers
Thread ID:
00540286
Message ID:
00540395
Vues:
26
>>>>how do you refresh a grid? I have one with the following
>>>>WITH THISFORM.grid1
>>>> ROWSOURCE= "Select price,quantity,noun from trans"
>>>> ENDW
>>>>and a click of a cmd button does the following :
>>>>SELE TRANS
>>>>GO TOP
>>>>DELE next 1
>>>>PACK
>>>>the grid goes empty after clicking. I've tried refreshing the form too.
>>>
>>>You may want to select into a cursor, then set your recordsource to an alias of the cursor. Then when you want to refresh the grid set the recordsource to " " then run the select statement again and reset the recordsource to the refreshed cursor. Keep in mind you will lose some property settings doing this type of refresh.
>>
>>Instead of using "with thisform.grid1 ...recordsource=ytemp..endwith"
>>I used "thisform.grid1.recordsource=ytemp"
>>and it worked. How do you explain that, I thought they both accomplished the same thing.
>
>I'm not sure but in the old code you posted before you used ROWSOURCE not RECORDSOURCE. I assumed it was a typo.

May I ask another quest related? After the grid gets "refreshed", I want control(focus) to go back to a textbox automatically, but it never does even when I implemtnt "thisform.mytextbox1.setfocus"
"Build a man a fire, and he's warm for a day.
Set a man on fire, and he's warm for the rest of his life."
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform