Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Multi column sorting in grid
Message
From
24/10/2011 08:00:42
 
 
To
23/10/2011 15:47:33
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 9 SP2
Miscellaneous
Thread ID:
01526657
Message ID:
01527162
Views:
50
>>I was envisaging this as letting the user to (to get the Company + Department + Surname order) click on the Company column header, which will then sort the grid by Company, then they can Ctrl+Click on the Department header which will set the order of the grid's recordsource to Company + Department and then they can Ctril+Click on the Surname column header and the full sort order will get set to Company + Department + Surname
>
>Some thoughts here --
>
>I can see the first click handling the first column as the selection and then set an order on that column; this is easy enough. Now when the user selects the second column with a Ctrl-Click, the program would have to get the first column selected (with the simple click) and then set the order on the combination of the two fields. Now the tricky part -- the user selects the third column (or any subsequent columns) with another Ctrl-Click -- how to know this is the third or later click?
>
>I would suggest building the index definition in a string on the grid class stored as a custom property. Each time the user selects just a mouse click (no Ctrl key) then this string is reset with just the column selected. Now when the user selects a column to next sort on via a Ctrl-Mouse click, you add that column to the string. I would also suggest that you display the contents in the grid from a cursor and then build the indexes on the fly.
>
>You also need to check that the user is not double selecting a column. While the index expression would not complain, I don't think it would make much sense but only add overhead to the index.

Thanks Greg,

those are good thoughts and if/when I get to the development of this I'll keep them in mind.
Frank.

Frank Cazabon
Samaan Systems Ltd.
www.samaansystems.com
Previous
Reply
Map
View

Click here to load this message in the networking platform