Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Dropping Record from grid
Message
De
31/08/2004 16:10:19
 
 
À
30/08/2004 14:33:33
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00937759
Message ID:
00938177
Vues:
44
Here is how I do it (just had to do this today as a matter of fact):
STORE ALIAS() TO scrollalias
PRIVATE osetcontrol
IF TYPE("_screen.activeform.activecontrol")="O" .and. !ISNULL(_screen.activeform.activecontrol)
	IF UPPER(_screen.activeform.name)="PROFILEFORM"
		osetcontrol = _screen.activeform.activecontrol
	ENDIF
ENDIF
oldscreen1 = ofrmProfile.lockscreen
ofrmProfile.lockscreen = .T.
*--1st grid on form ofrmprofile
IF TYPE('ofrmProfile.pgfProfile.pagPolicy.accountgrid')="O" .and. !ISNULL(ofrmProfile.pgfProfile.pagPolicy.accountgrid)
	WITH ofrmProfile.pgfProfile.pagPolicy.accountgrid
		SELECT TACCOUNT && recordsource of grid
		.SetFocus()
		FOR i= 1 TO .ActiveRow-1
	   	 .DoScroll(0)
		ENDFOR
	ENDWITH
ENDIF
*--2nd grid on form ofrmprofile
IF TYPE('ofrmProfile.pgfProfile.pagPolicy.policygrid')="O" .and. !ISNULL(ofrmProfile.pgfProfile.pagPolicy.policygrid)
	WITH ofrmProfile.pgfProfile.pagPolicy.policygrid
		SELECT TPOLICY  && recordsource of grid
		.SetFocus()
		FOR i= 1 TO .ActiveRow-1
	   	 .DoScroll(0)
		ENDFOR
	ENDWITH
ENDIF
IF !EMPTY(scrollalias) .and. USED(scrollalias)
	SELECT (scrollalias)
ENDIF
IF oldscreen1 = .f.
	ofrmProfile.lockscreen = .F.
ENDIF
IF WEXIST('PROFILEFORM') .and. TYPE("osetcontrol")="O" .and. !ISNULL(osetcontrol)
	osetcontrol.setfocus()
ENDIF
>Hello,
>I have a grid on a form that contains a column which in turn contains a command button. When the user clicks on the command button all occurences are removed from the grid that does not fit the current filter. Right now though when the user clicks the button all of that works but the next record in line moves to the top of the screen rather than staying put. How can I go about making this look better so that the user clicks on the button and that record and the other records drop out without the next record going to the top of the screen and looking rather ugly?
>
>Thanks for any help.
>
>--Troy
>
>Code from command button
>
>THISFORM.LOCKSCREEN = .T.
>LOCAL lcrecno, lnrecno
>lcrecno = ALLTRIM(DOCUMENT.crecno)
>lnrecno = RECNO("document")
>THIS.PARENT.PARENT.RECORDSOURCE = ""
>UPDATE DOCUMENT ;
>SET DOCUMENT.linclude = .F., ;
>DOCUMENT.lfetch = .F., DOCUMENT.lsend = .F. ;
>WHERE ALLTRIM(crecno) = lcrecno
>TABLEUPDATE(.T.,.T.,"document")
>GO (lnrecno)
>THIS.PARENT.PARENT.RECORDSOURCE = "document"
>WITH THIS.PARENT.PARENT
>	.colrec.CONTROLSOURCE="alltrim(document.crecno)"
>	.colnames.CONTROLSOURCE="document.cname"
>	.coldoc.CONTROLSOURCE="document.cdoctype"
>	.colprop.CONTROLSOURCE = "document.ntype"
>ENDWITH
>THIS.PARENT.REFRESH()
>THISFORM.LOCKSCREEN = .F.
>
.·*´¨)
.·`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"
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform