回复 5楼lov4023的帖子
你好,
自定义单元格类型需要做很多的测试及自定义,我这边建议使用另一种实现方法,请参考代码:
- private void Form1_Load(object sender, EventArgs e)
- {
- FarPoint.Win.Spread.CellType.ButtonCellType btnDelCellType = new FarPoint.Win.Spread.CellType.ButtonCellType();
- btnDelCellType.TextColor = System.Drawing.Color.Blue;
- btnDelCellType.Text = "删除";
- FarPoint.Win.Spread.CellType.ButtonCellType btnEditCellType = new FarPoint.Win.Spread.CellType.ButtonCellType();
- btnEditCellType.TextColor = System.Drawing.Color.Blue;
- btnEditCellType.Text = "编辑";
- this.fpSpread1.Sheets[0].Columns[1].CellType = btnEditCellType;
- this.fpSpread1.Sheets[0].Columns[2].CellType = btnDelCellType;
- this.fpSpread1.Sheets[0].ColumnHeader.Cells[0, 1].ColumnSpan = 2;
- this.fpSpread1.Sheets[0].ColumnHeader.Cells[0, 1].Text = "操作";
- }
复制代码
截图如下:
|