Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Multi column sorting in grid
Message
De
23/10/2011 15:47:33
 
 
À
23/10/2011 11:15:02
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:
01527136
Vues:
75
>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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform