找回密码
 立即注册

QQ登录

只需一步,快速开始

liu.bobo

高级会员

8

主题

14

帖子

1868

积分

高级会员

积分
1868

活字格认证

[已处理] 求Sample!

liu.bobo
高级会员   /  发表于:2012-4-11 10:31  /   查看:5051  /  回复:1
我们有在Spread画面一览里每一笔资料的最后一个Cell里面镶嵌多个处理Button的功能需求(如附件),请问有没有类似的sample,请提示。

jpg

jpg

1 个回复

倒序浏览
iceman
社区贡献组   /  发表于:2012-4-11 11:13:00
沙发
liu.bobo 你好,
操作步骤为:
1.合并列头单元格。
2.设置后四列 Border Size 为 0,进而隐藏 Border。
3.设置后四列单元格类型 ButtonCellType 。
测试代码:

  1. if (!IsPostBack)
  2.             {
  3.                 this.FpSpread1.Sheets[0].ColumnCount = 7;
  4.                 FarPoint.Web.Spread.ButtonCellType buttonType = new FarPoint.Web.Spread.ButtonCellType();

  5.                 this.FpSpread1.Sheets[0].ColumnHeaderSpanModel.Add(0, 3, 1, 4);

  6.                 FarPoint.Web.Spread.Border border = new FarPoint.Web.Spread.Border(BorderStyle.Solid, System.Drawing.Color.Black, 0);
  7.                 for (int i = 3; i < 7; i++)
  8.                 {
  9.                     this.FpSpread1.Sheets[0].Columns[i].CellType = buttonType;
  10.                     this.FpSpread1.Sheets[0].Columns[i].Width = 30;
  11.                     this.FpSpread1.Sheets[0].Columns[i].Border= border;
  12.                 }
  13.             }
复制代码
效果图:
MultiButtonInCell.png (16.9 KB, 下载次数: 111)
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 立即注册
返回顶部