Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Roy Slough
  Where is Roy Slough?
 Potters Bar
 United Kingdom
 Roy Slough
 Tags
Subject: Ordering and Filtering in a grid
Thread ID: 345207 Message ID: 345207 # Views: 54 # Ratings: 0
Version: Visual FoxPro 8 Category: Grids
Date: Sunday, May 20, 2012 4:00:15 PM         
   


Hi, I am displaying some records in a grid and I would like the user to change which subset (Filter)
and then the order in which they are displayed.

On the form I have a combo box selecting which subset (Filter) of records to display

SET FILTER TO syscodes.Ccodetype = thisform.cboFilterby.Value 
SET ORDER to TYPEORDER   && CCODETYPE+STR(ILISTORDER) 


Then on the click event of the column header I have
N.B I am using CHR(187) + CHR(171) to indicate which sort method is in operation
IF RIGHT(this.Caption,1) = CHR(171)
	SET ORDER TO cCodedesc ASCENDING 
	this.Caption = "Code Description " + CHR(187)
ELSE 
	SET ORDER TO cCodedesc DESCENDING 
	this.Caption = "Code Description " + CHR(171)
ENDIF 
Thisform.grdSyscodes.Refresh()


Now Bizzarly the set order to ascending shows all the records in ascending order, but
the set order to descending only shows one record

What Am I doing incorrect?

Thanks

ENTIRE THREAD

Ordering and Filtering in a grid Posted by Roy Slough @ 5/20/2012 4:00:15 PM
RE: Ordering and Filtering in a grid Posted by Anders Altberg @ 5/20/2012 5:05:39 PM
RE: Ordering and Filtering in a grid Posted by Stefan Wuebbe @ 5/20/2012 5:11:02 PM
RE: Ordering and Filtering in a grid Posted by Roy Slough @ 5/21/2012 3:00:21 PM
RE: Ordering and Filtering in a grid Posted by Stefan Wuebbe @ 5/21/2012 10:49:57 PM