Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Multi column sorting in grid
Message
De
21/10/2011 08:39:42
 
 
À
21/10/2011 00:25:40
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Visual FoxPro:
VFP 9 SP2
Divers
Thread ID:
01526657
Message ID:
01527035
Vues:
64
>>>Frank, what are you basically trying to do with the multi-sort grid? Find/pick a single item, or pull an ordered set?
>>>
>>
>>Hi Mark,
>>
>>the user has already retrieved a data set using various search/filter creiteria, now they want to locate a particular record. My grid lets them sort by clicking on the grid header, but they want to sort by more than one column at a time, so I want to let them click on the first column, then use ctrl+click on another column to sort by the first column and then the second column and so on.
>
>*************************
>Perhaps the following might help your thinking --
>
>Several years ago, I wrote an extensive app in FPW 2.6 to manage a car club (with about 1,000 members). One of the problems I solved was how to include a significant variety of members' cars in the database (several hundred permutations of year/make/model/series/customization/etc.) while,at the same time, enabling rapid, consistent input by the end-user. I accomplished this with a car-chart (table) of the permutations and a browse-pick routine (browse, for those whose memories do not go that far back, being a less-well-behaved predecessor to VFP's grid).
>
>The read-only browse-picker is called via a button next to the textbox that is being filled in. Positioning the "cursor" (highlighted cell) on a column both sorts and enables incremental search on that column. Tabbing from one column to the next drills down (filters the browse) on that term. Back-tabbing "drills up" (un-filters). In this manner, the user can add as many terms to the filter as desired (and "back out" all or part-way by removing terms from the filter). Left-arrow and right-arrow move the "cursor" from one column to the next without drilling. Up-arrow and down-arrow move up or down one row. Enter selects the desired permutation (i.e., the row where the "cursor" is currently positioned) and exits the picker, while Esc exits the picker without making a selection.
>
>I've been very pleased with how elegant a solution this has been for the end-user -- i.e., relatively few, intuitive keystrokes to make a pick based on multiple terms. I'm not advocating the use of a browse, of course -- but something comparable with a grid should be readily achievable.

Thanks for that detail Mark, but I'm not sure if I have misunderstood what you are describing (I'm a visual learner so reading this and picturing it is very difficult) or if you have misunderstood what I am trying to achieve. All I want to do is allow an end user to specify multiple columns of a grid to sort the gird by. So if for instance I have a grid with the following columns:

Company, Department, Surname, First Name

The user can sort the grid in this order:

Company + Department + Surname + First Name

and then change it to this:

Surname + First Name + Company + Department

with ease.

Ideally I would like them to just have to click on the first column, then ctrl+click to get subsequent columns included in the sort order.

I can program this from scratch if necessary, but was looking for any existing code that did something similar before spending the time on it.
Frank.

Frank Cazabon
Samaan Systems Ltd.
www.samaansystems.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform