liu.bobo 你好,
操作步骤为:
1.合并列头单元格。
2.设置后四列 Border Size 为 0,进而隐藏 Border。
3.设置后四列单元格类型 ButtonCellType 。
测试代码:
- if (!IsPostBack)
- {
- this.FpSpread1.Sheets[0].ColumnCount = 7;
- FarPoint.Web.Spread.ButtonCellType buttonType = new FarPoint.Web.Spread.ButtonCellType();
- this.FpSpread1.Sheets[0].ColumnHeaderSpanModel.Add(0, 3, 1, 4);
- FarPoint.Web.Spread.Border border = new FarPoint.Web.Spread.Border(BorderStyle.Solid, System.Drawing.Color.Black, 0);
- for (int i = 3; i < 7; i++)
- {
- this.FpSpread1.Sheets[0].Columns[i].CellType = buttonType;
- this.FpSpread1.Sheets[0].Columns[i].Width = 30;
- this.FpSpread1.Sheets[0].Columns[i].Border= border;
- }
- }
复制代码 效果图:
MultiButtonInCell.png
(16.9 KB, 下载次数: 152)
|