Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Grids...again
Message
 
À
21/05/1999 10:41:08
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Titre:
Divers
Thread ID:
00221374
Message ID:
00221380
Vues:
13
>I thought I had this thing licked but now I have another grid problem.
>
>I have a grid on a form. In the form Init method I have the following code:
>
>SELECT * FROM Deliverables WHERE nOSPKey=THISFORM.t_nOSPKey.VALUE INTO CURSOR Q_Deliv
>
>THIS.Grid1.RecordSourceType=1
>THIS.Grid1.RecordSource="Q_Deliv"
>THIS.Grid1.Column1.ControlSource="Q_Deliv.cAction"
>THIS.Grid1.Column2.ControlSource="Q_Deliv.dDueDate"
>THIS.Grid1.Column3.ControlSource="Q_Deliv.dcomplete"
>
>THIS.Grid1.Refresh
>
>This works fine and the grid displays the three columns properly. I have a refresh button and included the exact same code that I have in the Init method in the button click method. When I press the button the results of my cursor, Q_Deliv, are displayed in the grid instead of what I have defined for the columns. It's like the cursor was overlayed onto my grid. Any thoughts??
>
>TIA
>
>/Chris

Chris, you have to preserve the formatting of the grid by setting THIS.Grid1.RecordSource=""
as a first line before you rerun you SQL . Running the SQL again trashes the grid.RecordSource and the grid looses formatting.
Another approach here may be to use the view based on the same SELECT and just REQUERY () it.

Nick
Nick Neklioudov
Universal Thread Consultant
3 times Microsoft MVP - Visual FoxPro

"I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform