回复 1楼rongchao的帖子
实现方法请参考代码:
- private void Form1_Load(object sender, EventArgs e)
- {
- DataTable dt = new DataTable();
- dt.Columns.Add("第一列",typeof(System.Double));
- dt.Rows.Add(1.234534);
- this.fpSpread1.ActiveSheet.AutoGenerateColumns = false;
- this.fpSpread1.ActiveSheet.DataSource = dt;
- this.fpSpread1.ActiveSheet.Columns[0].DataField = "第一列";
- NumberCellType nct = new NumberCellType();
- nct.DecimalPlaces = 4;
- this.fpSpread1.ActiveSheet.Columns[0].CellType = nct;
- }
复制代码 |