Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 378
  • Last Modified:

Sorting the filelistbox

I have a filelistbox with a pattern, but i want the files to show sorted on creation date and time.
How can i do that?
0
amannien
Asked:
amannien
  • 2
1 Solution
 
MikeP090797Commented:
The filelistbox doesn't allow you to do that. Instead, you can transfer the file nmaes to a listbox, and sort them as you want
0
 
amannienAuthor Commented:
Ok, but what do you mean by that?
I have to read all the files into an array, sort then and then show them in a listbox?

Isn't there an easier way to do this?
0
 
rantanenCommented:
It won't help you. You want to sort them by date and time. If you even store them into the listbox so that there are only dates (which is not feasible), the sort won't work, because the stuff in the listbox is aplha is sorted as alpha, which gives quite different results than sorting by date.

The way to go is to abandon the filelistbox and use listview. Also listview has the same problems in sorting as such but it is possible to write additional code to do numeric sorting.
0
 
MikeP090797Commented:
He can sort an array, and then transfer it to a listbox
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now