Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Setting the Resize Method on a Dynamically created Grid
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00460425
Message ID:
00460564
Vues:
9
>I have created a grid on a form with 1 Column and and have added extra columns by setting the ColumnCount property of the grid at runtime. When I try to set the Resize Method I am told that it is read only. Is there a way around it?
>
>TIA

BTW, if you are using VFP 6, the following also works:
local lcCol
with ThisForm.Grid1
   lcCol = alltrim(str(.ColumnCount + 1))
   .NewObject("Column" + lcCol, "GridColumn", "PRG_Name_With_Column_Class.FXP")
   .Visible = .t.
endwith
The naming of the columns [first parameter] assumes you never remove a column from the middle. If you remove column 3 from a 4 column grid, ColumnCount drops to 3. If you add back another column, you will get an error when adding Column4 because you will already have a column named Column4. I leave it to you, to maintain the column naming.
Mark McCasland
Midlothian, TX USA
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform