listView Sort, First column,Int Descending.... C#?
I am trying to "sort" a column of a ListView in c#.
I would like to sort just the first colum, If i set the "sorting" properties to "descending", it sorts my data like this:
and it sorts my data-set like this:
96
876
76442
6
56
100000
(notice its not really descending, exept for the first char...)
How would i correct this so the ENTIRE number is considered when sorti开发者_如何学运维ng?, so 1000 is more then 500, currently it just reads the first char and makes 500 bigger then 1000.
I did some searching, seems i may need a "customer" sorter, Can anyone assist me?
This looks like a string-sorting issue. You might want to check that the data you are sorting is numeric data and not string data (note that many list view implementations will call ToString() on an object to get its value, causing the value to be string).
精彩评论