Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to save and restore user grid column preferences
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00641890
Message ID:
00641983
Vues:
18
A thought... I would not use WriteExpression, rather I would do somethinh like the following:
local aProp(1), aPem(1), i, oCol
if not file('SavePems')
    create table SavePems (cuser c(20),Pems m)
else
   use SavePems in 0
endif
locate for cUser == this.cuser
if not found('SavePems')
    append blank
    replace cUser with this.cUser
endif


dimension aProp(1)m aPem(1)
for i = 1 to aMembers(aPem,this.oGrid)
    if pemstatus(this.oGrid,aPem(i),1)    && Get the changed properties only
        dimension aProp(alen(aProp,1)+1)
        aProp(alen(aProp,1)) = 'this.oGrid.'+aPem(i)+'='+trans(eval('this.oGrid.'+aPem(i)))
    endif
endfor
for each oCol in this.oGrid
  for i = 1 to aMembers(aPem,oCol)
    if pemstatus(oCol,aPem(i),1)
      dimension aProp(alen(aProp,1)+1)
      aProp(alen(aProp,1)) = ;
        'this.oGrid.'+oCol.name+'.'+aPem(i)+'='+trans(eval('this.oGrid.'+ocol.name+'.'+apem(i)))
    endif
   endfor
endfor

save to Memo all like aProp
use in SavePems
Not tested you need to fill in the blanks, and figure out the restore.

Glenn
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform