Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Beginning ASP.NET 4 : in C# and VB
This is the forum to discuss the Wrox book Beginning ASP.NET 4: in C# and VB by Imar Spaanjaars; ISBN: 9780470502211
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 4 : in C# and VB section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old July 9th, 2013, 04:10 PM
Friend of Wrox
Points: 1,905, Level: 17
Points: 1,905, Level: 17 Points: 1,905, Level: 17 Points: 1,905, Level: 17
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: May 2011
Posts: 411
Thanks: 13
Thanked 7 Times in 7 Posts
Default modify date column

If you have a date column in your gridview that displays like:
9/27/2011 9:00:35 AM

And would rather have it displayed like in the MM-DD-YYYY format instead, how do you set that up in the grid so that displays in the format that you want it to.

Thanks once again

98783 Points

9691 Posts


Sorry I found the answer to this question already:
Re: DateTime Format in gridview colum

Jun 21, 2006 12:22 PM|LINK

Sure, if you're using a BoundField, simply do as follows:
<asp:boundfield datafield="Your_Date_Column" dataformatstring="{0:MMMM d, yyyy}" htmlencode="false" /> Just make sure you set the HtmlEncode attribute to False or it won't work.

Last edited by vbboyd; July 9th, 2013 at 04:30 PM..
Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
how to modify built in php's date function sandeepgreaternoida BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 0 April 1st, 2009 07:44 AM
sorting on date column in XSLT Palwi XSLT 1 March 18th, 2008 07:19 AM
Moving date from one column to another mattastic SQL Server 2000 2 October 6th, 2005 03:16 PM
re: modify the column in a xml file ramya General .NET 1 January 20th, 2005 04:50 AM
date column yagiroy SQL Server 2000 2 June 14th, 2003 01:19 PM

All times are GMT -4. The time now is 08:38 PM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.