Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to find which record shows first in a grid
Message
De
11/10/2012 03:26:51
Walter Meester
HoogkarspelPays-Bas
 
 
À
10/10/2012 12:31:26
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Divers
Thread ID:
01554683
Message ID:
01554764
Vues:
52
Try this:
PUBLIC oform1

oform1=NEWOBJECT("form1")
oform1.Show
RETURN


DEFINE CLASS form1 AS form
	DataSession = 2
	Top = 0
	Left = 0
	Height = 269
	Width = 351
	DoCreate = .T.
	Caption = "Get firstrow"
	firstrownumber = .F.
	Name = "Form1"

	ADD OBJECT grid AS grid WITH ;
		ColumnCount = -1, ;
		Height = 228, ;
		Left = 0, ;
		RecordSource = "Grid", ;
		Top = 0, ;
		Width = 348, ;
		Name = "Grid"

	ADD OBJECT command1 AS commandbutton WITH ;
		Top = 235, ;
		Left = 2, ;
		Height = 27, ;
		Width = 108, ;
		Caption = "Get TopRow", ;
		Name = "Command1"

	PROCEDURE getrownumber
		IF ISNULL(THISFORM.Firstrownumber)
			THIS.FirstRowNumber = RECNO()
		ENDIF
	ENDPROC

	PROCEDURE grid.Init
		USE (HOME()+"\samples\northwind\customers.dbf")
		THIS.RecordSourceType= 1
		THIS.RecordSource = "Customers"
		THIS.Column1.DynamicFontBold = "!THISFORM.Getrownumber()"
	ENDPROC

	PROCEDURE command1.Click
		THISFORM.FirstRownumber = NULL
		THISFORM.Grid.Refresh()
		WAIT WINDOW THISFORM.FirstRowNumber
	ENDPROC
ENDDEFINE
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform