GridView的格式化问题

GridView 的属性中,将某个column设置为:

DataFormatString="{0:yyyy-MM-dd}"  

发现格式化并没有起作用,同时修改

HtmlEncode="False"

才会发生作用, 为什么呢?

详细的解释:

When the HtmlEncode property is true, the value of the field is HTML encoded to its string representation before the formatting string is applied. For some objects, such as dates, you might want to control how the object is displayed with a formatting string. In those cases, you must set the HtmlEncode property to false.

 

 

你可能感兴趣的:(GridView的格式化问题)