回复 6楼ljqlovejmj的帖子
需要在数据绑定后按列分别设置:
- private void Form1_Load(object sender, EventArgs e)
- {
- DataTable dt = new DataTable();
- dt.Columns.Add("col1",typeof(int));
- dt.Columns.Add("col2", typeof(int));
- dt.Rows.Add("1", "12");
- this.fpSpread1.Sheets[0].DataSource = dt;
- FarPoint.Win.Spread.CellType.GeneralCellType gctype = new FarPoint.Win.Spread.CellType.GeneralCellType();
- gctype.FormatString="00000";
- this.fpSpread1.Sheets[0].Columns[0].CellType = gctype;
- this.fpSpread1.Sheets[0].Columns[1].CellType = gctype;
-
- }
复制代码 |