Originally posted by: Craig
Pete,
I lifted your routine and used it successfully to great acclaim from the boss after a 'whizkid' had been unable to implement this feature. All the credit is yours however and I did admit as much to him.
Thanks for making me look good.
Cheers,
Craig.
Originally posted by: Paulo Pra�a
Fantastic code, this is what I need.
Thanks,
Paulo Pra�a
Portugal
Originally posted by: Darren Lalonde
Excellent code, just what i needed
ReplyOriginally posted by: Miroslav Genov
Hi. I look you'r tutorial for number and date sorting but can you help me. I wan't to sort from one date to another.
Exam: If i have structure
struct person {
char name[30];
int num;
int dannum;
int day;
int month;
int year;
}persons[500];
and i wan't to sort this persons by date from one date to another do you know how i to do this.
Originally posted by: Mike
I like the sort. Worked well in my program. Appreciate the work you put into it. I've been looking for about 2 weeks now, and haven't found one until now. I'm sure I won't find one that rivals this either! Thanks again..
m.
ReplyOriginally posted by: Vince K
Hi, I looked for a while to find a good ListView sorting routine. Your was exactly what I needed.
Thank You
Vince K.
ReplyOriginally posted by: Sreenivas Chitluri
Thank you Pete,
I got solution for my application which needs the numerical values in the listview to be sorted. Once again thank you,
Sreenivas
Originally posted by: Jon H Hibbins
I got around date and number sorting by creating an extra column setting the size to 0 and locking the resize using sub classing (another example on this site),
the columns were
number display | number sort | date display | date sort
where the number was formatted 00000000000223223
then when the column header is clicked I sort on the next column along !
Works great and the sort is ultra fast !
Best Regards
Jon
I have recently been doing quite a lot of advanced things with the list view control and read your article at http://codeguru.earthweb.com/ on sorting lists,
and the date was formatted yyyymmdd
Originally posted by: Dyker
Private Sub OrderByDate(ListViewX As Object)
End Sub
try it, it's ten time faster and you 'll never see the $$$dummy$$$ column because the list will not repaint until the end.
What do you think ?
i 'd try using calback to sort items by date on a large list view (4000 items).
so i have another method:
Dim ListItemX As ListItem
Dim Index As Integer
ListViewX.ColumnHeaders.Add , "$$$dummy$$$", " "
Index = ListViewX.ColumnHeaders("$$$dummy$$$").SubItemIndex
On Error Resume Next
For Each ListItemX In ListViewX.ListItems
ListItemX.SubItems(Index) = Format(CDate(ListItemX.Text), "yyyymmddhhnnss")
Next
On Error GoTo 0
ListViewX.Sorted = False
ListViewX.SortKey = Index
ListViewX.Sorted = True
ListViewX.Sorted = False
ListViewX.SortKey = 0
ListViewX.ColumnHeaders.Remove ("$$$dummy$$$")
Originally posted by: Jeremie
Hi Pete,
I use your method to correctly sort the columns in my ListView, and it works very well.
Do you know why in the Windows Explorer the sort by column works correctly and not in the VB ListView controls ?
Regards,
Jeremie
Reply