Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Losing column widths in grid
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00133860
Message ID:
00133937
Views:
12
Barbara,
Thanks for your input. Having read it, it made perfect sense but when I tried it the column widths were still not the same as in design view. I tried both using the D.E. and the LOAD event to open the view with NODATA. I even tried setting the parameter to a value that it could not possibly be and let it retrieve an empty data set and the column widths were still altered.

Interestingly, I saved the form as a class and created another form based on that class and the column widths were fine (I didn't test this with the code I had before your patch). I don't get it.

Just curious, the original form was based on a class very much like the tsMaintform class from the Tas Traders sample. Could that be a contributing factor ?

--Carl

>This is a known problem caused by changing the grid RecordSource property. In your case, open the view in the LOAD event or DataEnvironment, marking NoDataOnLoad to be .T. Set the RecordSource of the grid to the view on the property sheet. In the INIT() code, when you have the correct parameter, do a ReQuery() on the view.
>
>HTH
>Barbara
>
>>I'm using a grid to display a parameterized view in a private data session with VFP5. There is one parameter for the view which is passed to the form by the calling program. The INIT method in the form receives that parameter and opens the view. It also assigns the view name to the RecordSource property of the grid.
>>
>>When the form displays, the column widths in the grid appear to have been altered to reflect the original field width for each field in the view. If I set the RecordSource property for the grid to the view name at design time, the colums are all altered to be very narrow (looks like about 1 screen column).
>>
>>My guess is that it's a matter of forcing the widths back to their design width but I'm not sure that can best be done.
>>
>>TIA,
>>
>>--Carl
Carl Chambers
Cardol Data Systems
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform