Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
GetFile analogue with ability to limit directory
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01044804
Message ID:
01045221
Vues:
27
>Hi Naomi,
>
>> It works quite nicely except that for some reason I can not re-order by clicking on the columns.
>
>
>Put the following code in the ListView's ColumnClick Method:
>
>
>*** ActiveX Control Event ***
>LPARAMETERS columnheader
>this.sortkey = columnheader.Index - 1
>
Yes, thanks. I already solved the sorting problem with the following code
* When a user clicks on a column header, this procedure fires and is passed
* the ColumnHeader object of the column header that was clicked on.
* This procedure will set the ListView's SortKey property to the 
* SubItemIndex value from the ColumnHeader
LPARAMETERS toColumnHeader
DO case     
case toColumnHeader.Key = This.ColumnHeaders(ThisForm.nLastSorted + 1).Key
	* user has clicked on column currently used for sorting, change SortOrder		
    
OTHERWISE && different column was clicked
	* user has clicked on new column - initial sort order will become ascending
	Thisform.nSortOrder = 0	
	This.ColumnHeaders(ThisForm.nLastSorted + 1).Icon = 0	
ENDCASE

DO case
   CASE toColumnHeader.Key = [Name]
        this.SortKey = 0
   CASE toColumnHeader.Key = [Size]
        this.SortKey = 5     
   CASE toColumnHeader.Key = [Type]
        this.SortKey = 2
   CASE toColumnHeader.Key = [LastModified]
        this.SortKey = 4
endcase

ThisForm.ListView.SortOrder = thisform.nSortOrder

toColumnHeader.Icon = IIF(thisform.nSortOrder = 0,1,2)

thisform.nLastSorted = toColumnHeader.SubItemIndex 

thisform.nSortOrder = IIF(thisform.nSortOrder = 0, 1, 0)  
thisform.ListView.Sorted = .T.
ThisForm.Refresh()
But now I'm having two problems:
1) The ListView is not themed and doesn't look nice (the same way as WE). From some old messages it looks like I have to use the version 5 of this ActiveX. I'm not sure, what consequences it would bring.

2) I can not install Help for this ActiveX and I could not find a way to show header's icon on the right side of the text in the Header.
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform