Hi
, Urgent
Please, how I sorting the listview in the columns ?
eg: I have
hour_ini hou_fim room
18:20 18:50 1
18:50 19:20 1
07:00 07:30 2
07:30 08:00 2
06:00 06:30 3
Is sorted for room , I want sort for hour_ini, How do I ?
07:00
Printable View
Hi
, Urgent
Please, how I sorting the listview in the columns ?
eg: I have
hour_ini hou_fim room
18:20 18:50 1
18:50 19:20 1
07:00 07:30 2
07:30 08:00 2
06:00 06:30 3
Is sorted for room , I want sort for hour_ini, How do I ?
07:00
set the sorted value to true and the sort key to the column's index that you want.
Thai
Private Sub ListView1_ColumnClick(ByVal ColumnHeader As MSComctlLib.ColumnHeader)
Static iLast As Integer
Static iCur As Integer
With ListView1
.Sorted = True
iCur = ColumnHeader.Index - 1
If iCur = iLast Then .SortOrder = IIf(.SortOrder = 1, 0, 1)
.SortKey = iCur
iLast = iCur
End With
End Sub