找回密码
 立即注册

QQ登录

只需一步,快速开始

chcchb
论坛元老   /  发表于:2013-6-24 09:34  /   查看:5088  /  回复:3
如题, 论坛里搜索了下,貌似ComponentOne Studio 有这个属性.


还有就是,鼠标移动上去后显示改单元格的全部内容(是不是 .Note 属性[这个属性在spread有分组后,貌似失效])

3 个回复

倒序浏览
iceman
社区贡献组   /  发表于:2013-6-24 17:19:00
沙发
回复 1楼chcchb的帖子

你好,

1.末尾以 '...' 形式显示,可以通过 TextCellType 实现,代码如下:

  1. if (IsPostBack)
  2.             {
  3.                 return;
  4.             }

  5.             FarPoint.Web.Spread.TextCellType txtype = new FarPoint.Web.Spread.TextCellType();
  6.             txtype.ShowEllipsis = true;

  7.             this.FpSpread1.Sheets[0].Cells[1, 1].CellType = txtype;
  8.             this.FpSpread1.Sheets[0].Cells[1, 1].Text = "testtesttesttesttest";
  9.             this.FpSpread1.Sheets[0].Cells[1, 1].Note = "testtesttesttesttest";
复制代码


2.分组后 note 属性失效,我通过以下代码没有重现问题,

  1.         protected void Page_Load(object sender, EventArgs e)
  2.         {
  3.             if (IsPostBack)
  4.             {
  5.                 return;
  6.             }

  7.             FarPoint.Web.Spread.TextCellType txtype = new FarPoint.Web.Spread.TextCellType();
  8.             txtype.ShowEllipsis = true;

  9.             this.FpSpread1.Sheets[0].Cells[1, 1].CellType = txtype;
  10.             this.FpSpread1.Sheets[0].Cells[1, 1].Text = "testtesttesttesttest";
  11.             this.FpSpread1.Sheets[0].Cells[1, 1].Note = "testtesttesttesttest";

  12.             FpSpread1.Sheets[0].GroupBarVisible = true;

  13.             //设置 group 信息

  14.             FarPoint.Web.Spread.SheetView sv = this.FpSpread1.ActiveSheetView;

  15.             sv.AllowGroup = true;

  16.             GroupDataModel gdm = new GroupDataModel(sv.DataModel);

  17.             sv.DataModel = gdm;

  18.             FarPoint.Web.Spread.SortInfo[] sort = new FarPoint.Web.Spread.SortInfo[1];

  19.             //设置分组列和排序方式
  20.             sort[0] = new FarPoint.Web.Spread.SortInfo(1, true);

  21.             gdm.Group(sort);

  22.             FarPoint.Web.Spread.Model.Group group = new Group(gdm, (FarPoint.Web.Spread.Model.Group)gdm.Groups[0], 0, false);

  23.             GroupFooter groupfooter = new GroupFooter(group);

  24.             FpSpread1.Sheets[0].GroupFooterVisible = true;

  25.         }
复制代码


效果图:

Demo1.gif
回复 使用道具 举报
chcchb
论坛元老   /  发表于:2013-6-25 14:07:00
板凳
1.这个属性有效

2. 汗,我代码里是 先分组,后给单元格的.note属性赋值,根据版主的代码,我将.note的顺序调整后, 该属性有效了
回复 使用道具 举报
iceman
社区贡献组   /  发表于:2013-6-25 18:56:00
地板
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 立即注册
返回顶部