Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Grid can't find SQL Cursor
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00304561
Message ID:
00306442
Vues:
39
>>It seems to me that Grids Initialise differently in VFP6 to VFP5. In 5 I often had to put the fields in the Column.controlsource property, or the Column.textbox.controlsource property to get the grid to display properly. This means to that the order of selection of fields in the cursor is not important, because the column can be set to whatever field is desired.
>>
>>But it seems to me that in 6 the column initialises before the grid and if the cursor is referred to either in the column or a textbox in the column, then an error occurs. This means that columns either have to be set programatically or else the order of fields in the cursor must correspond to the fields I wish to display in the grid, because the column.controlsource and column.textbox.controlsource are empty and the grid fills directly from the grid.recordsource
>
>Something has definitely changed in the way grids initialize from 5 to 6. I had a problem like yours, but I was able to fix it easily enough, I recall. One way is, as you say, by setting the column sources at runtime (try grid Init),

Yes, I could do this, I can see that the behavior is logically consistent, I just don't think it makes sense in this case to initialize the inner objects before the information (SQL) - It makes me think the programmers didn't really want the user to use an SQL or QPR to populate the rowsource.

> or not at all, in some cases, when fields and columns are aligned.

This is the solution I am using at the moment.

> Another way, I believe, was by removing the DBC from the project and opening it manually.

All my tables are opened manually.

>Watchout for using the "no controlsource" method. It may appear to work fine, but if you allow column moving, and do refresh of grid source, you can wind up with data in the the wrong columns if user moves columns around :)

All my grid columns are fixed - no moving or resizing, so this should be OK.

David
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform