Sorting dates in ListView


Author
Message
Juan Carlos Pazos
Juan Carlos Pazos
StrataFrame User (228 reputation)StrataFrame User (228 reputation)StrataFrame User (228 reputation)StrataFrame User (228 reputation)StrataFrame User (228 reputation)StrataFrame User (228 reputation)StrataFrame User (228 reputation)StrataFrame User (228 reputation)StrataFrame User (228 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...




Threaded View
Threaded View
Juan Carlos Pazos - 16 Years Ago
Trent L. Taylor - 16 Years Ago
Juan Carlos Pazos - 15 Years Ago
Trent L. Taylor - 15 Years Ago
Juan Carlos Pazos - 15 Years Ago
                         Juan, Try this as it worked for me and did not require any change to...
Trent L. Taylor - 15 Years Ago
                             OK...I found the problem. It will require a change. The column sorter...
Trent L. Taylor - 15 Years Ago
                                 Trent Thanks for your support and the time invested. I will wait for...
Juan Carlos Pazos - 15 Years Ago
                                     I might make the suggestion that you expose the ListViewSorter. That...
Greg McGuffey - 15 Years Ago
                                         Actually,it already is. The ListView has a Sorter property that allows...
Trent L. Taylor - 15 Years Ago
                                             OK, I just took a look at the source and I need to be more specific....
Greg McGuffey - 15 Years Ago

Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search