Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Need data input grid for color/size variations of invent
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Visual FoxPro:
VFP 9
Database:
Visual FoxPro
Divers
Thread ID:
01073047
Message ID:
01074874
Vues:
14
Terry,

Thanks for the example. What I ended up doing is very similar. First I build an array of all the color/size variations for the inventory part (i.e. aMatrix[Sizes, Colors]) which holds the Quantity In Stock for every color/size combination; then I create the grid programmatically along similar lines as the code you shared, except I use 'grid.AddColumn(i)'

The thing that tricked me initially was to know that I had to explicitly set the textbox to visible (grid.columns(i).text1.visible = .t.)

Cheers,

Alain

>
>As I read it you essentially want a grid with enough columns for an indeterminate no. of colours. Below is an example of the code I use to display census categories in a grid, when I don't know what census domains will be included. I think it's more or less what you want.
>
>HTH
>
>Terry
>
>
>With Thisform
>  .LockScreen		    = .T.
>  .nVarID			    = ZONEGVAR.VAR_ID  && all recs will have this PK
>  With .pgfMainPageFrame
>    With .Page3.grdVarZoneData
>      .FontSize		    = 8
>      .RecordSource	    = "CENSUSZN"
>      .ColumnCount		    = Thisform.nFieldCount - 2  && This determined by counting the cols of the table
>      With .Columns(1)
>	.FontBold		    = .T.
>	.ControlSource	    = "CENSUSZN.ZONE"
>	.Header1.Caption	    = "Zone"
>	.Header1.FontBold	    = .T.
>	.Width		    = 33
>	.Bound		    = .F.
>	With .text1
>	  .ControlSource	    = "CENSUSZN.ZONE"
>	  .Visible	    = .T.
>	EndWith
>      EndWith
>      Select CENSUSZN
>      For lnColNo = 2 to thisform.nFieldCount - 2
>	lcFieldName	    = ALLTRIM( FIELD( lnColNo + 2))
>	lcFieldCapt	    = DBGETPROP( "CENSUSZN." + lcFieldName, "FIELD", "CAPTION") && Get field caption
>	With .Columns( lnColNo)
>	  .Width		    = 66
>	  .FontBold	    = .T.
>	  .ControlSource      = lcFieldName
>	  .Header1.Caption	    = lcFieldCapt
>	  .Header1.FontBold   = .T.
>	  .Bound		    = .F.
>	EndWith				&& .Columns( lnColNo)
>      EndFor
>    EndWith				&& .Page3.grdVarZoneData
>  EndWith					&& .pgfMainPageFrame
>  .LockScreen		    = .F.
>EndWith					&& Thisform
>
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform