科学的表記がセルに表示されるときに12ビットの数値データは、数値データは15桁まで記憶することができる場合、それは15を超えた場合、ユニットは、以前にデジタルフォーマットのテキストに設定されてもよいです。
// 長い番号が自動的に消去Excelエクスポート科学表記になっ 用(int型 I = 0 ; I <e.Row.Cells.Count; I ++ ) { e.Row.Cells [I] .Attributes.Add(" スタイル"、" vnd.ms-excel.numberformat:@ " ); }
フロント
<DIV ID = "divGrid"にrunat = "サーバー"> <ASP:GridViewのID = "GridViewData"にrunat = "サーバ" OnRowDataBound = "GridViewData_RowDataBound"> </ ASP:GridViewの> </ div>
後ろ
保護された ボイド GridViewData_RowDataBound(オブジェクト送信者、GridViewRowEventArgs E) { GridViewRow GVR = e.Row。 以下のために(INT iが= 0 ; I <= gvr.Cells .Count - 1 ; I ++ ) { gvr.Cells [I] .Attributes.Add(" スタイル"、" vnd.ms-excel.numberformat:@ " )。 } }