Thursday, October 05, 2006

DataFormatString in a BoundField of a GridView

I had a simple little problem - the DataFormatString="{0:0}" in a BoundField was not working. After a bit of fiddling i found that the HTML Encoding was stopping it (by encoding the format string before it was applied). Simply setting HtmlEncode="False" in that BoundField fixed the issue.

No comments: