现在的位置: 首页 > 综合 > 正文

asp.net 导出Excel时,解决纯数字字符串变成类似这样的 2.00908E+18 形式的代码

2013年10月30日 ⁄ 综合 ⁄ 共 187字 ⁄ 字号 评论关闭

我们只需要在导出前,做如下处理,或者在该列加上以下代码中的样式就可以了。

foreach(DataGridItem dg in this.DataGrid1.Items)

{

     dg.Cells[列].Attributes.Add("style", "vnd.ms-excel.numberformat: @;");

}

this.DataGrid1.RenderControl(hw);

抱歉!评论已关闭.