sorting data in a listbox

Discussion in 'Questions (Windows Mobile)' started by gjoisa, Dec 12, 2008.

  1. gjoisa

    gjoisa Active Member Licensed User

    Hi all !
    I am confused about sorting data in ascending mode in a listbox . Can any one help ?
  2. klaus

    klaus Expert Licensed User

    There is no Sort property or method for ListBox on the device.
    There is one for the desktop, but it needs the Door library.
    You can first put your data in an ArrayList, sort it and then transfer the sorted data to the ListBox.

    Best regards.
  3. Erel

    Erel Administrator Staff Member Licensed User

    And here is a code that implements klaus suggestion:
    Sub Globals
    'Declare the global variables here.

    End Sub

    Sub App_Start
    End Sub

    Sub SortListBox(List)
    For i = 0 To Control(List,ListBox).Count-1
    For i = 0 To ArrayList1.Count-1
    End Sub
    It uses an ArrayList named ArrayList1 to sort listboxes. Depending on your type of data you may need to change the line:
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice