Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Locking columns in a grid
Message
De
16/11/2000 09:38:16
 
 
À
15/11/2000 13:32:59
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00442231
Message ID:
00442615
Vues:
10
>In VFP 6.0, is there a way to "freeze" a grid column's order without having to play around with the "partition" property and splitting the grid? I want to freeze the first few columns so I don't lose track of which record I am viewing while scrolling horizontally.

You could try to work out a way using the Left Column property and always reorder the columns you want locked to the front of the grid. Or you could work out a way with two grids, here's one option:
PUBLIC oForm
oForm = CREAT([oMyForm])
oForm.SHOW

DEFINE CLASS oMyForm AS FORM
	WIDTH = 500

	ADD OBJECT oBottomGrid AS oMyBottomGrid WITH ;
		TOP = 25, ;
		LEFT = 25, ;
		WIDTH = 420

	ADD OBJECT oTopGrid AS oMyTopGrid WITH ;
		TOP = 25, ;
		LEFT = 25, ;
		WIDTH = 197, ;
		HEIGHT = 180, ;
		SCROLLBARS = 0

	ADD OBJECT oPaintForm AS oMyTimer

	PROC INIT
		LOCKSCREEN = .T.
		THIS.oBottomGrid.DOSCROLL(5)
		THIS.oBottomGrid.DOSCROLL(4)
		LOCKSCREEN = .F.
		THIS.REFRESH
		THIS.CLICK
	ENDPROC
ENDDEFINE

DEFINE CLASS oMyBottomGrid AS GRID
	RECORDSOURCE = [labels.dbf]
	RECORDSOURCETYPE = 0

	PROC SCROLLED
	LPARAMETERS nDirection
		THISFORM.LOCKSCREEN = .F.
		THISFORM.oTopGrid.ZORDER(0)
		THISFORM.LOCKSCREEN = .T.
		THISFORM.PAINT
		THISFORM.REFRESH
	ENDPROC

	PROC INIT
		THIS.SETALL([Width], 50, [Column])
	ENDPROC
ENDDEFINE

DEFINE CLASS oMyTopGrid AS GRID
	RECORDSOURCE = [labels.dbf]
	RECORDSOURCETYPE = 0

	PROC INIT
		THIS.SETALL([Width], 50, [Column])
	ENDPROC
ENDDEFINE

DEFINE CLASS oMyTimer AS TIMER
	INTERVAL = 100

	PROC TIMER
		THISFORM.LOCKSCREEN = .F.
		THIS.ENABLED = .F.
	ENDPROC
ENDDEFINE
But I don't really think its a good user interface, especailly with the amount of columns you're suggesting, it just takes up space. Maybe one option is to have textboxes display the data off grid for the current row? Or maybe put it in the caption of the form?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform