找回密码
 立即注册

QQ登录

只需一步,快速开始

jingyuking

注册会员

14

主题

42

帖子

136

积分

注册会员

积分
136

活字格认证

jingyuking
注册会员   /  发表于:2014-5-27 14:51  /   查看:5389  /  回复:3
spread单元格内容超长时会自动换行,请问如何设置禁止单元格换行,超长部分自动隐藏。

3 个回复

倒序浏览
iceman
社区贡献组   /  发表于:2014-5-28 09:25:00
沙发
回复 1楼jingyuking的帖子

禁止这行代码如下:

  1.         protected void Page_Load(object sender, EventArgs e)
  2.         {
  3.             if (IsPostBack)
  4.             {
  5.                 return;
  6.             }
  7.             TextCellType tc = new TextCellType();
  8.             tc.AllowWrap = false;
  9.             tc.Multiline = false;

  10.             this.FpSpread1.Sheets[0].Cells[0, 0].CellType = tc;
  11.             this.FpSpread1.Sheets[0].Cells[0, 0].Text = "设置设置设置设置设置设置设置设置设置设置设置设置设置设置设置设置";
  12.         }
复制代码
回复 使用道具 举报
jingyuking
注册会员   /  发表于:2014-5-28 09:44:00
板凳
能通过前台JS实现吗?N多单元格,不可能一个一个都设置一下。
回复 使用道具 举报
iceman
社区贡献组   /  发表于:2014-5-28 10:02:00
地板
回复 3楼jingyuking的帖子

可以通过以下代码一次性设置表单所有单元格为不折行,无法通过js设置:

  1. this.FpSpread1.Sheets[0].DefaultStyle.CellType = tc;
复制代码
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 立即注册
返回顶部