DataFormatString not working with date format in GridView

I set the DataFormatString to {0:d} and also tried {0:MM-dd-yyyy} as several forums and articles suggested; but it still wouldn’t work and kept on displaying the entire string including the time. It turns out, all I had to do is add HtmlEncode=”false”.

<asp:GridView ID=”gridItems” runat=”server” AutoGenerateColumns=”False” DataKeyNames=”ItemId”
DataSourceID=”MyItemsDataSource” Width=”100%”>
<asp:BoundField DataField=”Title” HeaderText=”Title” SortExpression=”Title” />
<asp:BoundField DataField=”Status” HeaderText=”Status” SortExpression=”Status” />
<asp:BoundField DataField=”DateCreated” HeaderText=”Listed on” SortExpression=”DateCreated”
DataFormatString=”{0:d}” HtmlEncode=”false” />