Sorting a ListView
Posted on 2004-10-15
The following sub sorts a ListView based on which column you click:
Public Sub SortListView(ByVal lvw As MSComctlLib.ListView, ByVal colHdr As MSComctlLib.ColumnHeader)
lvw.SortKey = colHdr.Index - 1
lvw.Sorted = True
lvw.SortOrder = 1 Xor lvw.SortOrder
The problem I am having, is that on a certain column, it is only numerical values. I want it to be sorted from greatest value to least, but the system recognizes the first number...for example, the number 2 would appear before 15, because 2 is greater than 1...how do I fix this?