ListView Sorting Problem

This is a discussion on ListView Sorting Problem within the Windows Programming forums, part of the Platform Specific Boards category; What I need is a way to sort a listview based on dates. My first column is dates. What I ...

  1. #1
    Registered User
    Join Date
    May 2002
    Posts
    132

    ListView Sorting Problem

    What I need is a way to sort a listview based on dates. My first column is dates. What I need is the most current date at the top and so 01/01/2005 (MM/DD/YYYY) would be at the bottom.

    Is there any flags I could use to have it sorted with this method? Or would I have to make my own sorting functions? If I have to make my own is there a simple method of changing a row's # (say current row #3 has to become row #4 so then row #3 can be populated with a new row of data)?

    [EDIT]
    By the way, this is a ListView created with the LVS_REPORT style so it has multiple columns.
    [/EDIT]

    Thanks
    Tyouk

  2. #2
    Yes, my avatar is stolen anonytmouse's Avatar
    Join Date
    Dec 2002
    Posts
    2,544
    Have a look at ListView_SortItems. This allows you to provide a custom comparison function.

  3. #3
    Registered User
    Join Date
    May 2002
    Posts
    132
    Thanks

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Problem with malloc() and sorting words from text file
    By goron350 in forum C Programming
    Replies: 11
    Last Post: 11-30-2004, 09:01 AM
  2. Sorting text file problem...
    By John-m in forum C Programming
    Replies: 3
    Last Post: 10-01-2002, 04:51 PM
  3. ListView ImageList problem (MFC)
    By The Dog in forum Windows Programming
    Replies: 1
    Last Post: 09-12-2002, 12:08 PM
  4. sorting problem
    By Unregistered in forum C Programming
    Replies: 6
    Last Post: 08-01-2002, 11:46 AM
  5. Sorting array output problem
    By Unregistered in forum C Programming
    Replies: 4
    Last Post: 02-19-2002, 12:44 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21