回复 2楼moriya的帖子
请通过如下代码方式绑定数据源:
- DataTable dt = new DataTable();
- dt.Columns.Add("Col1");
- dt.Columns.Add("Col2");
- dt.Rows.Add("test", "test");
- this.fpSpread1.Sheets[0].AutoGenerateColumns = false;
- this.fpSpread1.Sheets[0].Columns[0].DataField = "Col1";
- this.fpSpread1.Sheets[0].Columns[1].DataField = "Col2";
- this.fpSpread1.DataSource = dt;
- this.fpSpread1.Sheets[0].RowCount = 500;
复制代码 |