我想有一列显示 2005年06月07日这种格式,如何强制设置; 货币栏显示 人民币的符号,如何设置?

解决方案 »

  1.   

    需要设置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. http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.boundfield.dataformatstring.aspx
      

  2.   

    楼上说的很正确,
    还一个一个方法是,将日期列变模板列后。
    在HTML中
    <%#Eval("date"),{0:D}%>
    这样也可以
      

  3.   

    HtmlEncode="False" 在哪里设置?