回复 1楼X765321的帖子
X765321 你好,测试代码如下:
- protected void Page_Load(object sender, EventArgs e)
- {
- if (IsPostBack)
- return;
- this.FpSpread1.Sheets[0].DataAutoCellTypes = false;
- FarPoint.Web.Spread.TextCellType textType = new FarPoint.Web.Spread.TextCellType();
- textType.Multiline = false;
- textType.AllowWrap = false;
- this.FpSpread1.Sheets[0].ColumnHeader.Cells[0, 0].CellType = textType;
- DataTable table = new DataTable();
- table.Columns.Add("第一列第一列第一列第一列第一列", typeof(System.String));
- table.Columns.Add("第二列", typeof(System.String));
- table.Columns.Add("第三列", typeof(System.String));
- table.Columns.Add("第四列", typeof(System.String));
- table.Rows.Add("一", "一一", "一一一", "一一一一");
- table.Rows.Add("一", "一一", "一一一", "一一一一");
- table.Rows.Add("一", "一一", "一一一", "一一一一");
- table.Rows.Add("一", "一一", "一一一", "一一一一");
- this.FpSpread1.Sheets[0].DataSource = table;
- }
复制代码 |