Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
User-defined grid's layout
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01153465
Message ID:
01153676
Views:
29
That should work, if you are not doing the entire grid you have to prevent the grid from blowing up with one of the standard techniques. Also this adds the column to the end of the grid so you may need to adjust the column order as well.

Bob

>>Hello,
>>
>>If you want to add a column dynamically you can use .AddObject with a subclassed custom grid column. Also please note there are some security issues associated with the method described in the article depending on where the data is and who has access. You can inject a case statement to just allow certain properties to be user managed.
>>
>>HTH
>>
>>Bob
>>
>I was thinking along these lines:
>
>thisform.myGrid.ColumnCount = thisform.myGrid.ColumnCount + 1
>++++++++++++ Info from script
>thisform.myGrid.Columns(thisform.myGrid.ColumnCount).ControlSource = ...
>thisform.myGrid.Columns(thisform.myGrid.ColumnCount).width = ...
>etc.
>
>*****************
>In other words, have only the new column definition in the memo field.
>Do you think this approach can work?
>
>Or you would suggest to define each possible requested field (so far there are only two combinations) as a class (may be in code) and just add a new column.
'If the people lead, the leaders will follow'
'War does not determine who is RIGHT, just who is LEFT'
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform