Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How many rows are there in grid?
Message
De
08/02/2008 04:20:02
 
 
À
07/02/2008 12:57:44
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Divers
Thread ID:
01290490
Message ID:
01290749
Vues:
22
>Is there any way to see total number of non-empty rows in a grid?

You can start with this raw code:
PUBLIC oform1

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

DEFINE CLASS form1 AS form

	ADD OBJECT grid1 AS grid WITH ;
		ColumnCount = 3, ;
		Anchor = 5, ;
		Height = 200, ;
		Left = 27, ;
		Top = 42, ;
		Width = 320

	ADD OBJECT command1 AS commandbutton WITH ;
		Top = 8, ;
		Left = 220, ;
		Height = 27, ;
		Width = 84, ;
		Caption = "click here"

	PROCEDURE call
		DEBUGOUT SECONDS(),RECNO()
	ENDPROC


	PROCEDURE Load
		CREATE CURSOR TEST (A I,B I,C I)
		FOR K=1 TO 300
			APPEND BLANK
		NEXT
	ENDPROC


	PROCEDURE command1.Click
               * optimize and put this code into the grid class
		WITH THISFORM.GRid1.Columns[1]
			PRIVATE rowsData
			rowsData = 0
			thisform.LockScreen = .T.
			.DynamicFontShadow = '_VFP.SetVar("rowsData",m.rowsData+1)'
			THISFORM.GRid1.Refresh
			.DynamicFontShadow = ''
			thisform.LockScreen = .F.
		ENDWITH
		this.Caption = TRANSFORM(m.rowsData)

	ENDPROC

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

Click here to load this message in the networking platform