Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Grid problem
Message
De
21/12/1999 20:16:28
 
 
À
21/12/1999 13:20:44
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Divers
Thread ID:
00306648
Message ID:
00307047
Vues:
23
>Hi John.
>
>>> i have a grid that display query result with several search keyword. The grid is not displayed as designed earlier (the width of the columns were changed) when I try to re-assign the recourcetype even the name of cursor is same. <<
>
>Anything that closes the RecordSource of the grid (like re-creating it bu re-running a query) will make it go blank. A better solution is to create an updateable cursor in the Form.Load using the following syntax:
>
>
>CREATE CURSOR grdCursor( Yada C(10), ;
>                         Nada C(20). ;
>                         Blah C(30), ;
>                         etc., etc, etc... )
>
>
>Then you can visually asign grdCursor as the RecordSource of your grid and bind the grid columns to the fields in the cursor. Then, whenever you want to change what the cursor contains, you can call a method that does somethiong like this:
>
>SELECT grdCursor
>ZAP
>*** Zapping is OK because it doesn't close the grid's RecordSource
>SELECT Yada, nada, blah etc. etc. etc,... FROM SomeTables WHERE SomeCondition INTO CURSOR Temp
>SELECT grdCursor
>APPEND FROM DBF( 'Temp' )
>USE IN Temp
>ThisForm.MyGrid.SetFocus()
>
>HTH
>
>Marcia

I used this way for long time, and I found that in certain situations it's still not 100% guarantee from grid losing its contents. So, I still use this approach, but fortify it when necessary by calling Grid.Init where all grid setting reside.
Edward Pikman
Independent Consultant
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform