If you have a BoundField in a GridView that displays a datetime, but you only want to display the date, how would you go about doing that?Set the DataFormatString to "{0:d}" ?That is what I thought too. Turns out, this doesn't always work.That is because by default the value is extracted from the data store, HtmlEncoded, and then the format string is applied. After HtmlEncoding, the format string won't do anything. The fix in most cases, is usually pretty simple. Just turn off HtmlEncoding for that field by setting HtmlEncode="false".If you can't turn off HtmlEncoding, it looks like there is some custom formating in your future.
Remember Me
a@href@title, i, strike, u
Copyright © 2003-2008 Falafel Software Inc.
Subscribe to Falafel Blogs
The opinions expressed herein are Falafel's employees own personal opinions and do not represent Falafel Software's view in any way in case they go bananas!