首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > asp.net >

GridView导入Excel数据列中以0开头的数据0丢失,该如何解决

2012-04-22 
GridView导入Excel数据列中以0开头的数据0丢失在网上搜了解决办法我也用了string style @style.text{

GridView导入Excel数据列中以0开头的数据0丢失
在网上搜了解决办法
我也用了string style = @"<style>.text{mso-number-format:\@;}</script>";
Response.Write(style);
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
  {
  if (e.Row.RowType == DataControlRowType.DataRow)
  {
  e.Row.Cells[0].Attributes.Add("class", "text");
  }
  }
但是仍然不起作用 请教大家是方法有错误或者还有其他解决办法吗?

[解决办法]
excel中的格式不正确导致的。
[解决办法]
e.Row.Cells[0].Attributes.Add("style", "vnd.ms-excel.numberformat:@");
加class不行
[解决办法]

探讨

e.Row.Cells[0].Attributes.Add("style", "vnd.ms-excel.numberformat:@");
加class不行

热点排行