Solved

ListView Time sort

Posted on 2011-09-21
1
345 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
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…
Progress

717 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