Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Sorting columns in grid not working
Message
De
16/02/2004 10:53:57
Mike Yearwood
Toronto, Ontario, Canada
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00877631
Message ID:
00877664
Vues:
15
Seems reasonable.

>Thanks for responding Mike,
>Should I remove the "Locate" and "setfocus"?
>
>
>>Hi Chuck
>>
>>How about adding a THIS.PARENT.PARENT.Refresh() to refresh the grid?
>>
>>>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
>>>
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform