formatted date in grid view?

S

Smokey Grindle

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!
 
K

Kushi

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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,225
Members
46,815
Latest member
treekmostly22

Latest Threads

Top