Results 1 to 4 of 4

Thread: Sorting listbox by date

  1. #1
    Guest
    I've got an array filled with date/monetary transaction data which needs to be displayed in a listbox on screen.

    I need to sort my listbox items by date, but don't know how. Also, how easy would it be to have two listboxes - one for the date and one for the transaction value - considering they need to stay relative?

    Cheers
    Mafro

  2. #2
    Frenzied Member Mark Sreeves's Avatar
    Join Date
    Nov 1999
    Location
    UK
    Posts
    1,845
    What format is your data in?

    Post an example.
    Mark
    -------------------

  3. #3
    Guest

    Date formats

    The date is in d/m/yy format:

    arrtrans(0, 0) = 10/4/00
    arrtrans(1, 0) = 350

    this then goes into two parallel listboxs:

    lstbox1 lstbox2
    10/4/00 350
    12/4/00 -200

    but then if I add a new transaction with an earlier date, I need it to insert into the correct place in lstbox1.

    Which means sorting lstbox1 by date, then perhaps using the .itemdata property to align the values in lstbox2.

    Is that enough info?
    Thanks a lot, this ones got me stumped!!

    Mafro

  4. #4
    Addicted Member
    Join Date
    Aug 1999
    Location
    Ottawa,ON,Canada
    Posts
    217
    If you want to keep both lists aligned and do a sort on the date list then why not use a flex grid with 2 columns? All your problems will disappear if you take this route, I presume. Also, if you want to bind the array to the grid you should check the feature on this site titled something like the "Grid Grammies".

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