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:
00001413
Vues:
62
>>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()

>
>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

Since the old order in my grids is another column that can be re-ordered, i don't save the old order. I'm missing something here, why would I want to save theold order? I would just go click on the column that has the old order to reestablish it.

I put the code into all of my Header clicks - and display the columns that can be sorted with italics - but it's not necessary. If a column cannot be sorted the click doesn't do anything for the user. I have a standard grid with 10 columns and alter the columncount at form time. I use MaxTech's framework for most of my base classes and have altered them somewhat...

Jim.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform