Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem changing Grids
Message
 
 
To
04/06/2004 00:21:43
Randy Wessels
Screentek Business Solutions, Llc.
Phoenix, Arizona, United States
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00909816
Message ID:
00909849
Views:
7
If you want to add columns programmatically, call the AddColumn function.

Linking tables to grids is also fairly easy. You first need to specify the RecordSourceType of the grid, then the actual RecordSource which will be the table name you are using. Set up a for loop to run through all the columns using the ColumnCount property for the number of columns and the Columns(lnCount) array for referencing them and update the ControlSource property of each column.

By default, a grid uses a standard textbox for each column, but to add a control to a column, you call the column's AddObject function and set the column's Sparse property to .F. and finally call the RemoveObject function to get rid of the old textbox. Adding new controls to a column allows you to specify the ControlSource on them whereas the old textbox doesn't like its ControlSource being set under certain circumstances.

I hope this helps.

>I am trying to learn VFP and support a legacy app. In several places, a >grid is used. I cannot seem to figure out how to change information on the >grid such as adding new columns, linking a field in a table or view to a >column and adding controls to the columns. I can view/change the properties >on the grid itself, but there doesn't seem to be a way to make changes.

>When I choose builder, I get a large amount of options and a wizard, but it >seems to start from scratch and not use any of the existing grid >information.

>Any ideas - am I just being stupid?
Previous
Reply
Map
View

Click here to load this message in the networking platform