Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Setting the Resize Method on a Dynamically created Grid
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00460425
Message ID:
00460564
Views:
11
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform