Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grid
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Re: Grid
Miscellaneous
Thread ID:
00965344
Message ID:
00965381
Views:
9
I have found the best way to fix this problem is to set most of the grid in code. Create the grid on the form and enter only the column count, widths and column headings. Then, create a form method with a name like GridSetup. In that you put code to define the grid recordsource and column ControlSource like:

With Thisform.grdInvcLines
.RecordSource = 'c_apshipln'
*
.Column1.ControlSource = 'c_apshipln.ManfId'
.Column2.ControlSource = 'c_apshipln.PartNo'
.Column3.ControlSource = 'c_apshipln.Desc'
.Column4.ControlSource = 'c_apshipln.Unit'
.Column5.ControlSource = 'c_apshipln.qtyord'
.Column6.ControlSource = 'c_apshipln.qtyrec'
.Column7.ControlSource = 'c_apshipln.qtyship'
.Column8.ControlSource = 'c_apshipln.cost'
.Column9.ControlSource = 'c_apshipln.extended'
.Column10.ControlSource = 'c_apshipln.balance'
EndWith


Run this in the form init and again after each time you renew the data. After using this method for a while I find it easier than clicking on each column and entering the data their. You can also use this to set the column widths, etc.
John.

>Hi,
>
>I created a grid and define the recordsource and set the column and text controlsource. I use cursor as recordsource. However when I redefined the recordsource for the grid again thru the code, the grid setting change. How to avoid the changes of the grid when I use select command into cursor.
>
>Thanks for help.
>
>Kusnardi
Beer is proof that God loves man, and wants him to be happy. - Benjamin Franklin
John J. Henn
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform