Monday, May 7, 2007

Format DateTime in GridView

Well, this could be very simple, but it could be hard if you don't know the key.

Just click on the arrow icon located at the top right corner of the GridView, and select "Edit columns...".
The following dialog box will be displayed.
Formatting DateTime in GridView
(Click on the above image to view the larger image)

Select the DateTime field.
Then change the value for the following properties:
* DataFormatString: {0:dd/MM/yyyy}
* HtmlEncode: False

You'll get the following DateTime display in your Gridview.
GridView DateTime display

No comments:

Post a Comment