找回密码
 立即注册

QQ登录

只需一步,快速开始

xiaopanghai

中级会员

3

主题

5

帖子

625

积分

中级会员

积分
625

活字格认证

最新发帖

[已处理] 单元格显示

xiaopanghai
中级会员   /  发表于:2012-8-2 21:25  /   查看:6341  /  回复:6
请问一个cell内的数据如何分行显示?就是字符串能够显示下时,中间显示。较长时能分两行显示在一个单元格内。

6 个回复

倒序浏览
iceman
社区贡献组   /  发表于:2012-8-3 09:27:00
沙发
回复 1楼xiaopanghai的帖子

xiaopanghai 你好,
可以使用 TextCellType 实现该功能,代码如下:
CSS:
  1.     <style type="text/css">
  2.         .test
  3.         {
  4.             text-align:center;
  5.             }
  6.     </style>
复制代码
C#:

  1. protected void Page_Load(object sender, EventArgs e)
  2.         {
  3.             if (IsPostBack)
  4.             {
  5.                 return;
  6.             }
  7.             FarPoint.Web.Spread.TextCellType text = new FarPoint.Web.Spread.TextCellType();
  8.             text.CssClass = "test";
  9.             text.AllowWrap = true;
  10.             text.Multiline = true;
  11.             string s = "This is a test for multiline";
  12.             this.FpSpread1.Sheets[0].Cells[0, 0].CellType = text;

  13.             this.FpSpread1.Sheets[0].Cells[0, 0].Text = s;
  14.         }
复制代码
回复 使用道具 举报
moriya
论坛元老   /  发表于:2012-8-3 11:33:00
板凳
樓主: 你可以采用雙標頭方式處理,你欄位太長,折疊起來用戶看起來也不舒服
回复 使用道具 举报
iceman
社区贡献组   /  发表于:2012-8-3 15:22:00
地板
回复 3楼moriya的帖子

:strong:
回复 使用道具 举报
xiaopanghai
中级会员   /  发表于:2012-8-4 11:40:00
5#
回复 2楼iceman的帖子

:v: 谢谢回答,问题得到解决了
回复 使用道具 举报
xiaopanghai
中级会员   /  发表于:2012-8-4 11:43:00
6#
回复 3楼moriya的帖子

谢谢提醒,已解决
回复 使用道具 举报
iceman
社区贡献组   /  发表于:2012-8-6 11:31:00
7#
回复 6楼xiaopanghai的帖子

:-D客气了
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 立即注册
返回顶部