How to Display Date Only Format in Gridview of ASP.NET?

When showing Date column in a GridView, it is often the case that you only need to display the date. Please include a DataFormatString attribute in your BoundField declaration.
<asp:BoundField DataFormatString="{0:d}" />

Please add an HtmlEncode="false" attribute in your column declaration.


No comments: