 |
|
|
|
GridView DataFormatString
|
|
|
 |
|
Location: Blogs Andy's Blog |
|
| Posted by: host |
1/26/2006 10:46 AM |
Here's some fun with the ASP.NET 2.0 GridView... I'm generally more of a templated column kinda guy, but I was feeling lazy and tried to format a BoundColumn as Currency using
DataFormatString="{0:c}" ... simple enough, right? Then why doesn't it work?! Turns out you have to set the HtmlEncode attribute to False in order for the DataFormatString to take...
< asp:BoundField DataField="Amount" HeaderText="Amount" ReadOnly="True" SortExpression="Amount" DataFormatString="{0:c}" HtmlEncode="False" /> |
|
| Permalink |
Trackback |
Comments (2)
Add Comment
|
Re: GridView DataFormatString
|
By Anonymous on
3/16/2006 3:49 PM
|
I did set HtmlEncode to 'false', still doesn't work.
Alex a_slv@yahoo.com
|
|
|
Re: GridView DataFormatString
|
By Anonymous on
4/3/2006 11:54 PM
|
THANK YOU. man, i was looking everywhere on how to get the "{0:C}" thing to work... wasn't working until i set the "HtmlEncode" to false. you rock
|
|
|
|
 |
|
 |
|
|