Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Crazy mixed up Grid
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00662722
Message ID:
00662754
Vues:
24
This message has been marked as the solution to the initial question of the thread.
What you're seeing is one of the limitations of blanking out the RecordSource and resetting it. It rebuilds the grid in it's original state, and will use the VFP column and header classes too. (Just in case you decided to substitute your own classes for the column and header, you should know about this.)

You can use a real view, because when you requery a view, you don't have to clear the recordsource first.

Another alternative is to direct the output of your SQL Select to a different cursor, select the RecordSource for the grid, zap it, and append from the DBF() of the cursor created by the SQL command.

>I am using a grid class as paraphrased below:
>
>with logrid
>  .ColumnCount = 3
>  .RecordssourceType = 1
>  .Recordsource = 'SomeCursor'
>  .columns(i).ControlSource = 'SomeCursor.Field3'
>  .columns(2).ControlSource = 'SomeCursor.Field1'
>  .columns(3).ControlSource = 'SomeCursor.Field2'
>endwith
>
>...
>
>Function Form::Load
>  this.ViewRequery()
>
>
>function ViewRequery
>thisform.Grid1.recordsource = ''
>lcSql = 'select field1,field2,field3 from sometable into cursor SomeCursor'
>thisform.Grid1.recordsource = 'SomeCursor'
>
>
>
>After the first requery of the cursor all is well, however on subsequent requeries the columns revert to cursor field order. If I re-assign column controlsources after the requery all is well again. What am I missing?
>
>Glenn
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform