When we load a Gridview from database value. by default it shows time with date in gridview column.
look like
if we want to show only date without the time then we have to add 2 property in column binding. HtmlEncode="False" DataFormatString="{0:d}"
The gridview aspx bind will be
the the gridview will llok like
look like
if we want to show only date without the time then we have to add 2 property in column binding. HtmlEncode="False" DataFormatString="{0:d}"
The gridview aspx bind will be
<Columns>
<asp:BoundField DataField="DistributorId" HeaderText="Distributor Id" />
<asp:BoundField DataField="Status" HeaderText="Status" />
<asp:BoundField DataField="ProductLine" HeaderText="Product Line" />
<asp:BoundField DataField="OrderID" HeaderText="Order Id" />
<asp:BoundField DataField="OrderDate" HeaderText="Order Date" HtmlEncode="False"
DataFormatString="{0:d}" />
<asp:BoundField DataField="EmployeeId" HeaderText="Employee Id" />
<asp:BoundField DataField="MessageId" HeaderText="Message Id" />
<asp:BoundField DataField="SendDate" HeaderText="Send Date" HtmlEncode="False" DataFormatString="{0:d}" />
</Columns>
the the gridview will llok like
Comments
Post a Comment