Sorting dates in ListView


Author
Message
Juan Carlos Pazos
Juan Carlos Pazos
Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)
Group: Forum Members
Posts: 144, Visits: 227
Hi

I have a ListView that works fine, except in one thing.

If I click on any column header the data sorts fine, in numbers and text, but some columns has dates and here the data sort as "numbers", for example, if I have records these:

Date
24/09/2008
15/10/2008
02/10/2008
13/10/2008
10/10/2008
15/09/2008

After clic the column header I got this:

Date
02/10/2008
03/10/2008
10/10/2008
15/10/2008
15/09/2008
24/10/2008

My system date format is (Day/Month/Year), that's why the dates are in that format.

If I click again the order is 24, 15,15,10,03,02

In the Rowpopulating event I have this:

e.Values(6).DisplayValue = bo.FechaEnvio.ToShortDateString

The sorting is only counting the first digits (the day in my case), Is there a way to fix this, to sort correctly for the complete date?

Kindest regards

Smile Everything is possible, just keep trying...

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search