Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Regenerate a Grid
Message
 
 
À
14/06/2007 16:36:00
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows XP
Database:
MS SQL Server
Divers
Thread ID:
01233274
Message ID:
01233313
Vues:
13
>>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform