Home SWOT Analysis How Strong U R? Articles About Us
Mahatma Gandhi Jawaharlal Nehru Bagat Singh Kamarajar Indira Gandhi

Oh Indian

In remembrance of the Independance day Aug 15, 2007

This site is dedicated to one and all who sincerely participated in freedom struggle. Let us try to fulfill their ambitions!
Skip Navigation Links

ASP.NET - Formatting Date Field in Grid View


Sometimes we wish to display the date and time differently than the system settings oriented display.

For example we wish to display in the formats dd-MMM-yy or dd-MMM-yy HH:mm:ss or simply
MMM-yyyy etc.

This is very simple to achieve. Do the following steps in order to do like this.

  1. Open the Properties window using GridView Tasks menu.
  2. Enter the DateFormatString property as shown in the picture. Make sure to enter a valid format string.
  3. Set the DataFormatString Property
  4. Don't forget to mark the HTMLEncode property to False.
  5. Setting the HTMLEncode to False
  6. Run to view the result.
Comments from Users (1)
laminate flooring 01-Sep-2010 06:41:31 
Laminate flooring is an inexpensive type of flooring that offers the consumer many benefits and is relatively easy to install.
Before getting started here is a pro and a con of laminate flooring. Laminate flooring gives your floor that overall look of wood that can be enjoyed for years to come.
Leave a Reply
Name (Required)  
Mail (will not be published) (required)    
Website
 
Invalid Domain! (http://loveletters.oh-indian.com/blogs/20070909/31/asp-net-formatting-date-field-in-grid-view.aspx) You are not allowed member of our Sites for link exchange!