Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > formatted date in grid view?

Reply
Thread Tools

formatted date in grid view?

 
 
Smokey Grindle
Guest
Posts: n/a
 
      06-22-2006
In .NET 1.1 I could have a column bound with date/time fields.. then say the
format of it was this {0:MMM d,yyyy h:mm tt} and it would display in this
format

Jan 1, 2006 2:03 PM

however in .NET 2.0 doing the same thing in the grid view with a date time
bound field to a column with the format string as {0:MMM d,yyyy h:mm tt}
gives me this

1/1/2006 02:03:00 PM

how do you get the 1st format to show correctly in a grid view now? I really
need to format the dates... thanks!


 
Reply With Quote
 
 
 
 
Kushi
Guest
Posts: n/a
 
      06-23-2006

Hi,

You need to set HtmlEncode property to false.

<asp:BoundField DataField="BirthDate" HtmlEncode=false
DataFormatString="{0:MMM d,yyyy hh:mm:ss}" HeaderText="BirthDate" />


Thanks
Sharmila
(www.syncfusion.com)

 
Reply With Quote
 
 
 
 
Smokey Grindle
Guest
Posts: n/a
 
      06-23-2006
humm didnt realize it as html encoding before display.. thanks!

"Kushi" <> wrote in message
news: ups.com...
>
> Hi,
>
> You need to set HtmlEncode property to false.
>
> <asp:BoundField DataField="BirthDate" HtmlEncode=false
> DataFormatString="{0:MMM d,yyyy hh:mm:ss}" HeaderText="BirthDate" />
>
>
> Thanks
> Sharmila
> (www.syncfusion.com)
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
get date and time formatted Larry C++ 1 01-20-2010 02:10 AM
Date validator when formatted David C ASP .Net 1 07-10-2009 11:11 PM
How To: Datagrid Date Column formatted if Null then "Active"? JDP@Work ASP .Net Web Controls 1 10-15-2004 07:38 PM
Date, date date date.... Peter Grison Java 10 05-30-2004 01:20 PM
How can i get the date formatted according to the regional settings made at the operating system level Karunakararao ASP .Net 0 05-11-2004 09:51 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57