Sorting using ListView Control in Visual Basic 6.0

Posted on 2005-04-06
Last Modified: 2008-01-09
  i have a listview control in visual basic 6.0 with item values containing numbers ex. 1, 2, 3, 4, 5 , 10, 100, when i try to sort by clicking a column header the sort arrangement is like this 1,10,100,2,3,4,5. i just want to know know how would i make the sort like this 1,2,3,4,5,10,100 using listview control.

Question by:nolram
    LVL 14

    Accepted Solution

    LVL 14

    Expert Comment

    by:Shiju Sasidharan
    LVL 1

    Expert Comment

    When you add a listitem make shure tha the number is inserted in string format with spaces on the left.


    @ should be repeated n times (as the max number chars you estimate needing)
    the example abouve only woks for numbers between 0 and 999999.

    hope to be of help

    Author Comment

    thanks so much.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Suggested Solutions

    Title # Comments Views Activity
    scoresClump  challenge 31 85
    Enhanced For loop vs ForEach Loop 4 42
    countX 22 49
    noX challenge 17 52
    Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
    A short article about problems I had with the new location API and permissions in Marshmallow
    An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    10 Experts available now in Live!

    Get 1:1 Help Now