There is a bug in older versions of the .NET 2.0 framework used for Visual Studio 2005. Even if you have a DataFormatString in your Gridview object, the column may still not format.

The workaround is to add the code

Code:

HtmlEncode ="false"

to that column

When HtmlEncode is on, the data is retrieved from the data store, Html Encoded, and then the format string is applied. By HtmlEncoding the value from the data store, the framework protects unsafe script from the data store from being displayed to the client.

I have observed this in the RTM versions of .NET 2.0 2.0.50727.42, as well as .NET 2.0 with security updates including 2.0.50727.832.*

The problem does not occur in the SP1 version of .NET 2.0 (2.0.50727.1433). This SP1 came with the .NET framework 3.5. Apparently this also did not occur in the beta version of .NET 2.0.