|
-
Feb 1st, 2001, 03:45 AM
#1
Thread Starter
Member
How do I sort a number and date data type in List View control. I have tried the sort function in List View but it is only sort by alphabetically
Can anyone help me ?
-
Feb 1st, 2001, 12:55 PM
#2
PowerPoster
Will this help?
Code:
Private Sub lvwCustomer_ColumnClick(ByVal ColumnHeader As MSComctlLib.ColumnHeader)
Listview1.SortKey = ColumnHeader.Index - 1
If Listview1.SortOrder = lvwAscending Then
Listview1.SortOrder = lvwDescending
Else
Listview1.SortOrder = lvwAscending
End If
Listview1.Sorted = True
End Sub
-
Feb 1st, 2001, 08:28 PM
#3
Thread Starter
Member
Thank for the reply Chris,
I have tried it it already. But I am afraid it does not work for date and number.
The things is that listview always sort alpahabetically. So it treats everything as text.
Any idea ?
-
Feb 1st, 2001, 08:54 PM
#4
Lively Member
The Listview can't do it, you should look at a work around. For example, use a recordset to sort the data (numbers) and fill the listview again.
-
Feb 2nd, 2001, 01:29 AM
#5
Thread Starter
Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|