Hello,
I am currently using Listview control.
The sorting feature of the control is useful.
It sorts well with Text type
but is weird when sorting Number Type.
Ex.
(before sorting)
[1st] 3
[2nd] 2
[3rd] 11
[4th] 4
[5th] 1
(after sorting)
[1st] 1
[2nd] 11
[3rd] 2
[4th] 3
[5th] 4
The correct one should be:
[1st] 1
[2nd] 2
[3rd] 3
[4th] 4
[5th] 11
How to sort number type correctly?
I am currently using Listview control.
The sorting feature of the control is useful.
Code:
<ListviewCtrlName>.Sorted = True
<ListviewCtrlName>.SortKey = <FieldToSort>
<ListviewCtrlName>.SortOrder = <SortOrder>
It sorts well with Text type
but is weird when sorting Number Type.
Ex.
(before sorting)
[1st] 3
[2nd] 2
[3rd] 11
[4th] 4
[5th] 1
(after sorting)
[1st] 1
[2nd] 11
[3rd] 2
[4th] 3
[5th] 4
The correct one should be:
[1st] 1
[2nd] 2
[3rd] 3
[4th] 4
[5th] 11
How to sort number type correctly?