Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Question about Sparse
Message
De
16/05/2008 16:22:13
 
 
À
16/05/2008 15:07:36
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 8 SP1
Divers
Thread ID:
01317715
Message ID:
01317742
Vues:
16
I think I found the problem. The grid RecordSource and column ControlSource are established in code in the form's init. When the code executed, the intended RecordSource was not the selected workarea. There were matching fields (item_no and part_no) in the currently selected workarea and that is the value being displayed. I selected the correct alias before setting the properties and am getting the desired display.


>I have a grid with four columns. The controlsource for each column is a field in the grid's recordsource. The sparse property for all columns is set to .T.
>
>The data source would be something like
>TYPE     ITEM NO    PART_NO     REV
>CHG         94      ABC-1234     A
>DEL         39      DEF-1234     B
>ADD         39      XYZ-1234     C
>CHG          1      QWE-1234     D
>             2      QWE-2345
>             3      QWE-3456
>
>But the data is displaying as
>TYPE     ITEM NO    PART_NO     REV
>CHG          1      QWE-1234     A
>DEL          1      QWE-1234     B
>ADD          1      QWE-1234     C
>CHG          1      QWE-1234     D
>             1      QWE-1234
>             1      QWE-1234
>
>I've set Sparse = .F. for all columns and that corrected the display problem, but I'm curious as to what would cause columns 1 and 4 to show values "correctly" but columns 2 and 3 show repeated values based on a record from the middle of the recordsource.
>
>We have a different screen showing exactly the same data. It uses a different grid control (VFP base class) with Sparse set .T. for all columns and showing all the data rows with the correct values. That grid has a filtered table as the recordsource while mine uses a cursor.
>
>Help for Sparse
>True (.T.) (Default) Only the Column's active cell uses the CurrentControl property setting to accept and display data. The other cells use the TextBox control if the current control for the cells is not the container object or a command button. The other cells remain empty if the current control for the cells is the container object or a command button.
>
>False (.F.) All cells in the Column object use the CurrentControl property setting to display data; the active cell accepts data.

>
>I think I understand this, but I'm not sure how to interpret it for my situation.
>
>Has anybody come across this or can shed some light on why the columns are displaying differently?
>
>Thanks.......Rich
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform