Grid View Data Bind
i have a database table with 4 columns having data type Date. I want to bind this database table with a grid view but the problem is grid view take these columns as DateTime and displays date and time in the grid view. please can any one help me. I want only date.
You can try out below
<columns>
<asp:BoundField headertext="CreationDate" dataformatstring="{0:M-dd-yyyy}" datafield="CreationDate" HtmlEncode="false" />
<asp:BoundField headertext="UpdationDate" dataformatstring="{0:M-dd-yyyy}" datafield="UpdationDate" HtmlEncode="false" />
</columns>
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.