如果某个单元格内容超过该列的宽度时,就会显示为多行,可以使用下面的代码来设置不要换行显示:
- protected void Page_Load(object sender, EventArgs e)
- {
- FarPoint.Web.Spread.GeneralCellType gct = new FarPoint.Web.Spread.GeneralCellType();
- gct.AllowWrap = false;
- gct.Multiline = false;
- this.FpSpread1.ActiveSheetView.Columns[0].CellType = gct;
- this.FpSpread1.ActiveSheetView.Cells[0, 0].Value = "测试文本不能超长,不然就要换行。";
- }
复制代码 |