Solved

ListView Time sort

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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

This is an explanation of a simple data model to help parse a JSON feed
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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 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 …

744 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

14 Experts available now in Live!

Get 1:1 Help Now