Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Sort Grid Columns?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00000436
Message ID:
00001314
Vues:
57
>Hi Tom,
>
>Thought you would be interested in seeing how I
>finally had to code the click() method to work
>with a variety of grids... one thing I had to
>contend with is that I wanted the column to sort
>in that field, even though the ORDER was set to
>slightly different... ie. cusid is the field, but
>the ORDER is cusid+DTOC(date) (sales history
>file). What I ended up doing is setting the TAG to
>cusid in the database... it then matches the field
>bound to the column and the column is
>automatically sorted and in this case, also sorts
>the dates as well within the cusid.
>
>here's the code... (if you see anything that I've
>forgotten, let me know!)
>
>Note: I established a property for each grid for
>the last
>SET ORDER TO, so that I could determine if it was
>ascending
>or descending and switch appropriately.
>
>GRDBASE.HEADER.CLICK()
>
>* If Clicked, AND if there is a TAG to this
>column, then SORT IT.
>
>LOCAL lcSetOrder, lcOrder, lcControlSource
>
>lcSetOrder=This.Parent.Parent.icSetOrder
>SELECT (This.Parent.Parent.RecordSource)
>
>FOR i=1 TO TAGCOUNT()
> lcOrder=UPPER(TAG(i))
>
>lcControlSource=UPPER(This.Parent.ControlSource)
> IF "." $ lcControlSource
> lcControlSource=SUBSTR(lcControlSource, ;
>RAT(".",lcControlSource)+1)
> ENDIF
>
> IF lcControlSource==lcOrder
> IF !EMPTY(lcSetOrder)
> IF "DESCENDING" $ lcSetOrder
> SET ORDER TO &lcOrder ASCENDING
> ELSE
> SET ORDER TO &lcOrder DESCENDING
> ENDIF
> ELSE
> SET ORDER TO &lcOrder ASCENDING
> ENDIF
>
-----> This.Parent.Parent.icSetOrder=SET("ORDER")
> This.Parent.Parent.Refresh()
>
> ENDIF
>ENDFOR
>>

Jim

Is th code noted above supposed to save the old Order? If it is then should it be moved further up?

Also, is this for all Header clicks (generic) or for a limited number?


Tom
Tom
--------------------------------
Tom O'Hare
407-299-4268 -- tom@redtile.com -- http://www.redtile.com/
Independent Programmer Using Visual FoxPro, Visual Basic & more...
Operations Manager -- Virtual FoxPro User Group (VFUG)
http://www.vfug.org/ -- tom@vfug.org
President -- Central Florida FoxPro User Group (CFFUG)
http://www.redtile.com/foxpro/
Universal Thread Most Valued Professional (MVP)
http://www.transformation.com/foxpro/
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform