Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Preserving grid properties
Message
De
27/03/2004 11:54:53
 
 
À
27/03/2004 11:07:07
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00888244
Message ID:
00890169
Vues:
15
>I ´ve downloaded a grid's class from Portalfox (Luis María Guayan was its author) which has two methods.
>1) PreservarColumnas()-which keeps all grid's properties
>2-RestaurarColumnas() restores all grid's properties.
>
>*-- Grid::PreservarColumnas
>LOCAL lo
>FOR EACH lo IN THIS.COLUMNS
> STORE lo.CONTROLSOURCE TO ("lo."+lo.CURRENTCONTROL+".Tag")
>ENDF
>THIS.TAG = THIS.RECORDSOURCE
>THIS.RECORDSOURCE=""
>
>*-- Grid::RestaurarColumnas
>LPARAMETERS lcAlias && si no está en la grilla debe especificarse acá
>LOCAL lo, lc
>THIS.RECORDSOURCE = IIF(NOT EMPTY(lcAlias),lcAlias,THIS.TAG)
>FOR EACH lo IN THIS.COLUMNS
> lc = EVAL("lo."+lo.CURRENTCONTROL+".Tag")
> IF NOT EMPTY(lc)
> IF NOT '.'$lc && sin alias asignado: lo asigna ahora
> lc = THIS.RECORDSOURCE+'.'+lc
> ENDIF
> lo.CONTROLSOURCE = lc
> ENDIF
>ENDFOR
>
>
>Working with VFP8 i add a grid based on my class, set grid properties at design time, and set form's bindcontrols=.f. and put this code in Init method works fine
>
>*Init code
>THISFORM.LOCKSCREEN=.T.
>THISFORM.Migrid1.PreservarColumnas() &&to keep grid column's properties
>**code to load your cursor
>thisform.migrid1.restaurarcolumnas('yourcursorname')
>thisfom.bindcontrols=.t.
>thisform.Refresh()
>thisform.LockScreen= .F.

Thanks for the additional info.
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform