Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grids and programmatically scrolling
Message
From
31/08/2004 09:12:25
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Grids and programmatically scrolling
Miscellaneous
Thread ID:
00937978
Message ID:
00937978
Views:
49
Nevermind. The below works fine:
IF TYPE('ofrmProfile.pgfProfile.pagPolicy.accountgrid')="O" .and. !ISNULL(ofrmProfile.pgfProfile.pagPolicy.accountgrid)
	WITH ofrmProfile.pgfProfile.pagPolicy.accountgrid
		SELECT TACCOUNT
		.SetFocus()
		FOR i= 1 TO .ActiveRow-1
	   	 .DoScroll(0)
		ENDFOR
	ENDWITH
ENDIF
IF TYPE('ofrmProfile.pgfProfile.pagPolicy.policygrid')="O" .and. !ISNULL(ofrmProfile.pgfProfile.pagPolicy.policygrid)
	WITH ofrmProfile.pgfProfile.pagPolicy.policygrid
		SELECT TPOLICY
		.SetFocus()
		FOR i= 1 TO .ActiveRow-1
	   	 .DoScroll(0)
		ENDFOR
	ENDWITH
ENDIF
I have two grids on a form. Each resides on its own pageframe. I want each grid to be sitting at the last record in the table when it first has focus. This has been done easily. However, what happens is that the grid is automatically scrolled to the bottom of the grid and the only line visible in the grid is that last row. I need to determine how many scrolls I need to perform to make as many rows visible as can be done based on the height of the grid without losing the visibility of the last row in the grid. I know, in one example, the .activerow property = 4 and the .relativerow property = 1. The grid height is 134 and the row height is 18.

I thought I remembered seeing code posted on the UT to do this, but I can't locate it doing a search.

I thought I could at least do a scroll upwards with the below code:
WITH ofrmProfile.pgfProfile.pagPolicy.accountgrid
	.SetFocus()
	FOR i= 1 TO .ActiveRow-1
   	 .DoScroll(0)
	ENDFOR
ENDWITH
WITH ofrmProfile.pgfProfile.pagPolicy.policygrid
	.SetFocus()
	FOR i= 1 TO .ActiveRow-1
   	 .DoScroll(0)
	ENDFOR
ENDWITH
TIA,
Tracy
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Next
Reply
Map
View

Click here to load this message in the networking platform