Results 1 to 4 of 4

Thread: How do I sort entries in a listbox by not using the..

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2000
    Posts
    3

    Post

    sorted property. In my listbox I have two entries, filename and filedate. I want the user to be able to click on filename or filedate and the contents of the listbox will be resorted depending on the button they click on.

    Thanks.


  2. #2
    Hyperactive Member
    Join Date
    Feb 2000
    Posts
    284

    Post

    If you are using a recordset to fill your listbox then you could just add an 'Order By' clause to your select statement and refill your listbox with the new recordset.

    ie.

    If the user selects 'Filedate' you can then fire off a SQL statement such as
    SELECT filename, filedate FROM filestable ORDER BY filedate
    then refill the listbox

  3. #3

    Thread Starter
    New Member
    Join Date
    Feb 2000
    Posts
    3

    Post

    I'm not using a recordset, I'm filling my listbox with the filename and filedate from a specified directory. I need to be able to sort the listbox either by filename or by filedate.

    Any ideas?

    ***************************************

    Originally posted by Bigley:
    If you are using a recordset to fill your listbox then you could just add an 'Order By' clause to your select statement and refill your listbox with the new recordset.

    ie.

    If the user selects 'Filedate' you can then fire off a SQL statement such as
    SELECT filename, filedate FROM filestable ORDER BY filedate
    then refill the listbox

  4. #4
    Guest

    Post

    I think this is what you are looking for:
    <A HREF="http://www.mvps.org/vbnet/code/callback/lvsortcallback.htm" TARGET=_blank>
    Sorting ListView ListItems Using Callbacks
    </A>


    ------------------

    Vincent van den Braken
    EMail: [email protected]
    ICQ: 15440110
    Homepage: http://www.azzmodan.demon.nl





    [This message has been edited by Azzmodan (edited 02-14-2000).]

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