GridView and BoundField DataFormat Strings with Dates
Posted by: Rick Strahls WebLog,
on 29 Oct 2006 |
View original | NEW Bookmarked: 0 time(s)
More in the line of stupid pet tricks: I keep running into this particular issue from time to time and promptly forget the solution, so Im blogging it again for my own sanity.
If you use GridView and you have a BoundField column in you might run code like this to format a date string:
<asp:BoundField DataField="OrderDate" DataFormatString="{0:d}" HeaderText="Date"
meta:resourcekey="BoundField">
...