How to Sort Date in Listview Control
Submitted by admin on Monday, January 26, 2009 - 17:35.
As we know that we cannot sort the column in listview that contain a date value. There is however a work around in Microsoft Website on how to do this. This can be found at http://support.microsoft.com/kb/170884.
Although it will solve your problem but after testing it I found out that it cannot sort the date by descending order. Of course you can add another code to do it. But it will again add another line of code.
The simple solution to this problem is to create a dummy column same with the column that has a date value. All you need is to format the field with "'yyyymmdd" format.
See the screenshot below.
[inline:Sort Date Column Screenshot.jpg=Sort Date in a Column]
Comments
Add new comment
- Add new comment
- 103 views