Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Regenerate a Grid
Message
 
 
To
14/06/2007 16:36:00
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows XP
Database:
MS SQL Server
Miscellaneous
Thread ID:
01233274
Message ID:
01233313
Views:
14
>>I think my solution is better. :)
>
>Sure, but I tried to give specific answer. There are situations when 'setgrid' method is really needed, e.g. when cursor structure is changed a bit, etc.

Hi Edward,

Just in case it will help some lurkers I post code from my grid class which saves properties (ideas mostly from my colleagues) as a script in cGridScript grid's property, which may be later executed with Execscript:

SaveGridProperies (only saves width, but may be extended)
if empty(this.cGridScript)
	local lcGridScript, lcReference, loColumn

	lcReference = sys(1272, this)
	lcReference = "_screen.ActiveForm." + substr(m.lcReference,at(".",m.lcReference)+1)

	set textmerge on
	set textmerge to memvar lcGridScript noshow && TEXTMERGE begins on the next line.

\With <<m.lcReference>>
	for each loColumn in this.columns

        \.<<loColumn.name>>.ControlSource = "<<m.loColumn.ControlSource>>"
        \.<<loColumn.name>>.width = <<m.loColumn.width>>
	next
\endwith
	set textmerge to
	set textmerge off

	this.cGridScript = m.lcGridScript
endif
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform