public void gvdataRowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Cells[0].Attributes.Add("style", "vnd.ms-excel.numberformat:@");
e.Row.Cells[2].Attributes.Add("style", "vnd.ms-excel.numberformat:@");
}
}
<td style='vnd.ms-excel.numberformat:@'></td>
另注: //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%