470,631 Members | 1,713 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,631 developers. It's quick & easy.

ASP.NET 2.0 GridView Bug? DataFormatString doesn't work

When I try to apply {0:d} to date or {0:c} to number (for currency), my
GridView doesn't apply the format. It still shows DateTime as it comes from
database with time and currency as just a number without $ sign. Formatting
in my DataGrids still works just fine.

Is anyone else experiencing the same problem?

Thanks,
-Boris
Jan 8 '06 #1
4 2411
You need to set the HtmlEncode property to false.

http://msdn2.microsoft.com/en-us/lib...oundfield.aspx

--
Andrew Robinson
www.binaryocean.com

"Amelyan" <ba******@wi.rr.com> wrote in message
news:uh**************@TK2MSFTNGP14.phx.gbl...
When I try to apply {0:d} to date or {0:c} to number (for currency), my
GridView doesn't apply the format. It still shows DateTime as it comes
from database with time and currency as just a number without $ sign.
Formatting in my DataGrids still works just fine.

Is anyone else experiencing the same problem?

Thanks,
-Boris

Jan 9 '06 #2
http://p2p.wrox.com/topic.asp?TOPIC_ID=38050

this should solve your problem, set the htmlencode property to false
for formatting to work correctly.

Jan 9 '06 #3
i tried to reply to this once and it didn't seem to work...

http://p2p.wrox.com/topic.asp?TOPIC_ID=38050

should help you out...

turn htmlencode property to false

Jan 9 '06 #4
it worked,
Thanks,

"tfsmag" <tf****@gmail.com> wrote in message
news:11**********************@g49g2000cwa.googlegr oups.com...
http://p2p.wrox.com/topic.asp?TOPIC_ID=38050

this should solve your problem, set the htmlencode property to false
for formatting to work correctly.

Jan 9 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by George Hester | last post: by
1 post views Thread by frank | last post: by
4 posts views Thread by bbp | last post: by
5 posts views Thread by Shimon Sim | last post: by
10 posts views Thread by Sourcerer | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.