Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Sorting columns in grid not working
Message
From
16/02/2004 10:53:57
Mike Yearwood
Toronto, Ontario, Canada
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00877631
Message ID:
00877664
Views:
14
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
>>>
Previous
Reply
Map
View

Click here to load this message in the networking platform