Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Fix for a grid with 2 rows...
Message
From
27/07/2004 14:53:04
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00928387
Message ID:
00928425
Views:
22
This message has been marked as a message which has helped to the initial question of the thread.
VFP have a bug, correlate with AllowAddNew property.
You can see this bug if the last data row have not a full blank row bottom.

Run this like start point ( grid have not a KeyPreview property !):
PUBLIC oform1

oform1=CREATEOBJECT('form1')
oform1.Show

DEFINE CLASS form1 AS form

	ADD OBJECT grid1 AS grid WITH ;
		Left = 32, ;
		ScrollBars = 1, ;
		Top = 26, ;
		height = 74	&& with inf to 92 the DNARROW,... scroll the grid
		
	PROCEDURE Load
		CREATE CURSOR myCursor (aa c(10))
		APPEND BLANK
		APPEND BLANK
	ENDPROC

	HIDDEN PROCEDURE Grid1.DoScroll
	ENDPROC

	PROCEDURE Grid1.MouseWheel
		LPARAMETERS nDirection, nShift, nXCoord, nYCoord
		NODEFAULT
	ENDPROC

	PROCEDURE Grid1.Init
		GO TOP IN (m.this.RecordSource)
	ENDPROC

	PROCEDURE Grid1.AfterRowColChange(nColOrder)
		IF m.this.Height<92		&& A WORKAROUD TO THE BUG
			IF m.this.RelativeRow=2
				ON KEY LABEL DNARROW	RETURN
				ON KEY LABEL PGDN		RETURN
				* OTHER OTHER KEYS
			ELSE
				ON KEY LABEL DNARROW
				ON KEY LABEL PGDN
			ENDIF
		ENDIF
	ENDPROC

	PROCEDURE Grid1.BeforeRowColChange(nColOrder)
		IF m.this.Height<92		&& A WORKAROUD TO THE BUG
			IF m.this.RowColChange=0
				ON KEY LABEL DNARROW
				ON KEY LABEL PGDN
			ENDIF
		ENDIF
	ENDPROC
	
ENDDEFINE
Previous
Reply
Map
View

Click here to load this message in the networking platform