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

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

foreach(DataGridItem dg in this.DataGrid1.Items) { dg.Cells[列].Attributes.Add("style", "vnd.ms-excel.numberformat: @;"); } this.DataGrid1.RenderControl(hw);
posted @ 2009-08-24 18:20  老蒋  阅读(1850)  评论(1编辑  收藏  举报