|
-
Sep 11th, 2000, 02:27 PM
#1
Thread Starter
Member
Hello,
I'm trying to display some data in a listview and one of the columns on which I wish to allow the user to sort will be filled with numerical data (e.g. 1202,323,566,etc). Here is the code I'm using right now:
Private Sub lvwmain_ColumnClick(ByVal ColumnHeader As MSComctlLib.ColumnHeader)
If lvwmain.SortKey = ColumnHeader.Index - 1 Then
If lvwmain.SortOrder = lvwAscending Then
lvwmain.SortOrder = lvwDescending
Else
lvwmain.SortOrder = lvwAscending
End If
End If
lvwmain.SortKey = ColumnHeader.Index - 1
lvwmain.Sorted = True
End Sub
This works fine on the columns in which there is string data, but when I try to sort the numerical data, it puts the 1000's above the 200's for exampls
Col1 Col2
---- ----
Hank 1102
John 233
Phil 266
Alex 299
etc...
How can I make this listview sort it so that the numbers are in the correct order? Thanks in advance!
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
|