Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to sort grid box record when clicking the header?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00184218
Message ID:
00184619
Vues:
22
>>> My friends suggest me to build index for each column on the cursor. Is it the only way? If the grid box have 12 column, will I build 12 index?
>>
>>An approach I use is to only add the index tag if necessary when the user clicks on the heading.
>
>It's fairly typical (but certainly not always necessary) to have a tag (permanently in the structural CDX) on every field in a table which you think might ever (a) be used in a FOR clause, or (b) be used to order the table.
>
>If you have a largish table, creating an index "on the fly" (or requerying a view/cursor with a new "order by") will take what the user thinks is a long time. Maybe several minutes (to index) if the table is large enough. But permanent tags in the structural CDX are kept up to date as the data is changed, and setting order to that TAG happens quickly.

You can ignore that whole message. I just re-read that you're talking about a cursor, not a table. So any indices have to be created either at the start of the form or grid, or when the user clicks on the header.

That means it's up to you, and what your users will accept. Do they want the form/grid to seem to load slowly while all the indices are being created, or do they want it to seem to take a long time to change the order when they click on the column header?

HTH,
Rich Addison, Micro Vane, Inc., Kalamazoo, MI
Relax, don't worry, have a homebrew.
- Charlie Papazian, The New Complete Joy of Home Brewing
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform