GridView column formatting
-
I have a gridview that I'm correctly binding correctly, but I can't seem to get the formatting of a datetime column correct and was hoping I could get some advice on what I'm doing wrong. The column, I have defined as I originally had DataFormatString="MM/dd/yyyy", but that literally displayed just that, so the {} part helped. Now, however, it displays the time in addition to the date, which is something I don't want. Is there some trick with the number before, or the specific formatting that I'm using that is making it display the full datetime?
-
I have a gridview that I'm correctly binding correctly, but I can't seem to get the formatting of a datetime column correct and was hoping I could get some advice on what I'm doing wrong. The column, I have defined as I originally had DataFormatString="MM/dd/yyyy", but that literally displayed just that, so the {} part helped. Now, however, it displays the time in addition to the date, which is something I don't want. Is there some trick with the number before, or the specific formatting that I'm using that is making it display the full datetime?
-
Hi there, You simply set the BoundField.HtmlEncode Property [^] to
false
as this property has thetrue
value by default and this causes the formatting not to work.Worked perfectly, thanks.