Results 1 to 2 of 2

Thread: sorting

  1. #1

    Thread Starter
    Lively Member
    Join Date
    May 2002
    Location
    Australia
    Posts
    73

    sorting

    I want to sort a listview in ascending order.

    When I sort the values from 1 to 1000, I get the following

    1
    10
    100
    101
    102
    ....
    ...
    11
    110
    111
    ....
    12
    120
    ....
    13
    ..
    1000
    2
    20
    21
    22
    ...

    and so on. Is there any way that I can sort the values so they actually fall into the correct order ... ........ 1,2,3,4,5,6,7,8,910,11,12,13,14 and so on.

    Any idea's
    Hugh Rees
    SERTEV Technologies
    (07) 3375 9806
    0410 585 754
    WWW.SERTEV.COM

  2. #2
    Hyperactive Member Bananafish's Avatar
    Join Date
    Jan 2001
    Posts
    394
    Well, one way would be to format the numbers with leading zeroes when you write it to the list box.

    ie,

    VB Code:
    1. lstbox.Items.Add intNumber.ToString("0000")

Posting Permissions

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



Click Here to Expand Forum to Full Width