CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: Multicolumn Listbox Sorting problem

  1. #1
    Join Date
    Apr 2020
    Posts
    1

    Question Multicolumn Listbox Sorting problem

    Hi all,
    cannot seem to find a solution to this:
    I have a multicolumn Listbox (3 columns) like this:
    ________________
    Name| VAL1| VAL2 |
    -----------------------
    aaaaa | 2 | 12.733 |
    cccccc | 2 | 11.456 |
    ddddd | 1 | 10.877 |
    bbbbb | 2 | 9.555 |

    Nested in the same sort, I'd like to sort by the second column (VAL1) in Descending order AND by the third column (VAL2) in Ascending order so that it would then be like this:

    ________________
    Name| VAL1| VAL2 |
    -----------------------
    bbbbb | 2 | 9.555 |
    cccccc | 2 | 11.456 |
    aaaaa | 2 | 12.733 |
    ddddd | 1 | 10.877 |



    Does anyone know if this can be done?
    Thanks in advance...and stay safe.

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    19,732

    Re: Multicolumn Listbox Sorting problem

    Just sort your data in the order you wish before filling in the listbox.
    Victor Nijegorodov

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)