Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Multi column sorting in grid
Message
From
24/10/2011 08:04:04
 
 
To
23/10/2011 20:39:17
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 9 SP2
Miscellaneous
Thread ID:
01526657
Message ID:
01527163
Views:
37
>>>Check your in box.
>>
>>Thanks Marcia (and Tore).
>>
>>It seems that I haven't really explained myself properly as this isn't what I'm looking for. I don't want the user to sort things in the grid by dragging the rows (although that may come in handy elsewhere). I want the user to be able to sort the entire contents of the grid by specifying which columns to sort on.
>>
>>So If I have a grid showing the following columns:
>>
>>Company, Department, Surname
>>
>>I want the user to be able to sort the grid by:
>>
>>Company + Department + Surname
>>
>>or by:
>>
>>Department + Surname
>>
>>or by
>>
>>Surname
>>
>>or by
>>
>>Surname + Company + Department
>>
>>or any other possible combination.
>>
>>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.
>
>
>Frank,
>
>The way I see it,
>
>i) if you dont want this generic and you have only a number of fields, you could consider to create all the possible indexes your user would be able to select, than create a cursor with all these indexnames and load a comboxbox with these values.
>Put this combobox over your header and let the user select a value from the combobox.
>ii) in case you would like to have it generic you should make a cursor with all the appropiate fields, load in a mover listbox and create an index according to listbox, something similar UI like as the native VFP query wizard.
>Please report back which option is your favorite and maybe we can assist you programming the requested option.
>
>However my advise: let your users first 'play' and enjoy the simple sortingroutine as made by Marcia which workes very fine.
>
>Best regards,
>
>Koen

Thanks Koen,

the framework I use does have a combo that can be used for sorting as you described, but I want my system to be a bit more flexible than that and I don't want to have to make up all the possible combinations (or is it permutations, I hated statistics) of 10 columns (or more).

As far as the actual programming of whatever technique goes, that should not be a problem, I've been doing this for a while now :)
Frank.

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

Click here to load this message in the networking platform