Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grid Headings when SQL - Select into Cursor 'refreshes'
Message
 
To
04/05/2000 02:55:39
Michael Vaccarello
Insurance Data Processing, Inc.
Wyncote, Pennsylvania, United States
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00364968
Message ID:
00366230
Views:
30
Hi Michael,

>I have almost the same problem. I have 6 tables with exactly the same fields and a drop down that the user can pick a table from with a grid below. When they pick a different table, I load that table with an alias of SHOWDATA (to keep it constant). The Grid still resets itself. Any thoughts???

When you load the table (use table alias SHOWDATA), is the Grid's recordsource still set?

The procedure (as noted above <G>) is as follows:
* Clear the RecordSource to keep grid from rebuilding its columns
thisform.oGrid.RecordSource = ""

* Get the data
use (table) alias SHOWDATA

* Restore the RecordSource so the grid can display it.
thisform.oGrid.RecordSource = "SHOWDATA"
IF the columns of the grid skip or reorder any columns in the alias, you need to save/restore them as well. For example, my grid class has the following methods:
*Save Column ControlSources
local x

dimension This.aColCtrlSrc[This.ColumnCount]
for x = 1 to .ColumnCount
	This.aColCtrlSrc[x] = .Columns[x].ControlSource
endfor

This.cRecordSource = This.RecordSource
This.RecordSource = ""

*Restore Column ControlSource
local x

This.RecordSource = This.cRecordSource
for x = 1 to This.ColumnCount
	This.Columns[x].ControlSource = This.aColCtrlSrc[x]
endfor
HTH,
Bill Armbrecht
VFP MCP
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform