Monday, 21 April 2014

Display only date in Gridview

When we retrieve the data from database to gridview it displays date and time both to display only date in gridview add DataFormatString property in Boundfield of Gridview.

E.g: <asp:BoundField DataField="pos_dt" HeaderText="Sales order Date" SortExpression="pos_dt" DataFormatString="{0:d}" />

It only displays date in our Gridview.

Thank You...
Happy Coding.... 

No comments:

Post a Comment