Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How To Persist Grid column widths
Message
De
08/12/2005 17:53:26
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
08/12/2005 15:11:35
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Divers
Thread ID:
01076375
Message ID:
01076442
Vues:
49
This message has been marked as a message which has helped to the initial question of the thread.
>Is there a simple means of persisting a grid's column widths? We have some columns whose data width can sometimes extend beyond the default width of the grid column. There is not enough room to display all columns in the grid though so if a user extends the width of column1 then column6 is no longer visible (without scrolling). Some users would like to see changes to grid column widths persist though. Is there a simple means of doing this? Where to store the information?

I do that in an ini file... here's my column class, relevant parts:
Define Class gcol As Column
	cSection=""
	Procedure Init(tcCaption, tcSource, tcClass, tcClassLib)
		With This
			.cSection=Chrtran(Sys(1272,This),".","_")
			lnWidth=prof_r(This.cSection,"width",This.Width,"N")
			If Not Empty(lnWidth)
				.Width=lnWidth
			Endif
			.ColumnOrder=prof_r(This.cSection,"columnorder", .ColumnOrder,"N")
*-- other stuff was here, which uses the parameters passed
		Endwith
	Endproc

	Procedure Cleanup
		prof_w(This.cSection, "width",This.Width)
		prof_w(This.cSection, "columnorder",This.ColumnOrder)
	Endproc

Enddefine
The column.cleanup is called from grid.destroy() - because of the columnOrder, which I'm also preserving (so it also remembers the order of columns, not just their widths). columnOrder is already zero during column.destroy(). Prof_w and prof_r are the routines to write and read a private profile string - I figure you probably got your own.

It's up to you to have one ini file per user, if you want.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform