1) 文本:vnd.ms-excel.numberformat:@
2) 日期:vnd.ms-excel.numberformat:yyyy/mm/dd
3) 数字:vnd.ms-excel.numberformat:#,##0.00
4) 货币:vnd.ms-excel.numberformat:¥#,##0.00
5) 百分比:vnd.ms-excel.numberformat: #0.00%
用法:在GridView的RowDataBound事件中加入代码e.Row.Cells[0].Attributes.Add("style", "vnd.ms-excel.numberformat:@");
您可能感兴趣的文章:
- Gridview利用DataFormatString属性设置数据格式的方法
- GridView自定义分页实例详解(附demo源码下载)
- ASP.NET数据绑定GridView控件使用技巧
- 浅析GridView中显示时间日期格式的问题
本文由 华域联盟 原创撰写:华域联盟 » GridView导出Excel常见的5种文本格式 原创
转载请保留出处和原文链接:https://www.cnhackhy.com/61486.htm