nolram
asked on
Sorting using ListView Control in Visual Basic 6.0
hi
i have a listview control in visual basic 6.0 with item values containing numbers ex. 1, 2, 3, 4, 5 , 10, 100, when i try to sort by clicking a column header the sort arrangement is like this 1,10,100,2,3,4,5. i just want to know know how would i make the sort like this 1,2,3,4,5,10,100 using listview control.
thanks.
i have a listview control in visual basic 6.0 with item values containing numbers ex. 1, 2, 3, 4, 5 , 10, 100, when i try to sort by clicking a column header the sort arrangement is like this 1,10,100,2,3,4,5. i just want to know know how would i make the sort like this 1,2,3,4,5,10,100 using listview control.
thanks.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
When you add a listitem make shure tha the number is inserted in string format with spaces on the left.
ListView1.ListItems(1).Tex t=format(" 1","@@@@@@ ")
@ should be repeated n times (as the max number chars you estimate needing)
the example abouve only woks for numbers between 0 and 999999.
hope to be of help
ListView1.ListItems(1).Tex
@ should be repeated n times (as the max number chars you estimate needing)
the example abouve only woks for numbers between 0 and 999999.
hope to be of help
ASKER
thanks so much.
http://vbnet.mvps.org/index.html?code/callback/lvsortcallback.htm
;-)
Shiju