Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Sorting columns in grid not working
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Sorting columns in grid not working
Divers
Thread ID:
00877631
Message ID:
00877631
Vues:
68
I use 4 columns in a grid to sort the displayed data. The data is suppose to be sorted by that field when the user clicks on the column header. I have the header changing colors to show that it is the sort order. Problem is I have to click on the navigation buttons or roll the mouse wheel to get the sort order to change. Is there an easy solution to this? This is the code used. The last 5 lines of code was my attemp to move the pointer so the sort order would change without using the nav buttons or mouse wheel. Thanks
LOCAL nOldRec,lnPos,lcOrder,lcColor
nOldRec = recno()
store 0 to lnPos
store "" to lcOrder, lcColor
* get current text color
WITH This
	lcColor = .ForeColor
	IF lcColor = RGB(128,0,128)	&& purple color 8388736
		lcColor = RGB(0,0,0)	&& black color 0
		SET ORDER TO
	ELSE
	    WITH .Parent
	* tag is the field name - get from column controlsource
		lnPos=RAT('.',.ControlSource)
		lcOrder=SUBSTR(.ControlSource,lnPos+1)
	        IF tagno(lcOrder)>0 
		   SET ORDER TO (lcOrder)
		ENDIF
		lcColor = RGB(128,0,128)	&& purple color
		.Parent.clmPmtType.hdrPmtType.ForeColor = rgb(0,0,0)
		.Parent.clmElement.hdrElement.ForeColor = rgb(0,0,0)
		.Parent.clmAgency.hdrAgency.ForeColor = RGB(0,0,0)
	    ENDWITH
	ENDIF
	LOCATE 
	.ForeColor = lcColor
	.Refresh()
	.parent.setfocus
	goto nOldRec
ENDWITH 
Extreme Programming = Plan -> Design -> Code -> Test
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform