I agree with your friends. Though I might not bother maintaining an index on fields that aren't likely sort candidates.
Some people have subclassed their grid headers (which works if you are using code-based classes), so that they will have this capability in their click. You could relatively easily get the header's parent's controlsource (if your columns are bound) and build an index on the fly.
This would be useful for view-based grids where you don't have persistent indices.
>Hello,
> I use the Visual Foxpro 3 to 6.
> How to code the grid box, so that when I click one of the column header, the records will be sorted base on that column?
> 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?
> Can I code this function on grid level rather than cursor level?
>Thanks. :D
>-Jasper
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement