Solved

ListView Time sort

Posted on 2011-09-21
1
341 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
New to SOAP and need some direction 10 47
LINQ - C# to VB convertion 12 48
Not showing page correctly 3 31
Advice in Xamarin 21 57
Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

863 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

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now