Solved

ListView Time sort

Posted on 2011-09-21
1
342 Views
Last Modified: 2012-05-12
Hello... I've written a small application using C#.net.
... in this application I have a listview which returns An ID number, time, and notes...
If I click the header of each column in sorts it from A to B, etc....  my problem lies in the Time sort...
if I click the Time header it sorts it and treats it as a string....
so instead of sorting;
5:00am
6:00am
5:00pm

it sorts;
5:00am
5:00pm
6:00am

How do I get it to sort based on the time..

Here is my line of code that gets the time and the rest of the column info from the access database

listView2.Items.Add(ds.Tables["Notes"].Rows[x]["NotesID"].ToString());
 listView2.Items[x].SubItems.Add(ds.Tables["Notes"].Rows[x]"Tim"].ToString());
 listView2.Items[x].SubItems.Add(ds.Tables["Notes"].Rows[x]["Notee"].ToString());
0
Comment
Question by:MrMay
1 Comment
 
LVL 37

Accepted Solution

by:
Neil Russell earned 500 total points
ID: 36575091
Use 24 hour format is only way I can think of.
0

Featured Post

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is about my first experience with programming Arduino.
If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question