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.
Printable View
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.
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
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?
***************************************
Quote:
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
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).]