回复 5楼weizebin的帖子
如果需要隐藏 buttom,则需要重置对应单元格类型。
请使用以下代码测试:
- private void Form1_Load(object sender, EventArgs e)
- {
- SetCellType();
- CustomizeButtonVisible();
- }
- private void SetCellType()
- {
- 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 = "编辑";
- for (int i = 0; i < 10; i++)
- {
- for (int j = 1; j < 3; j++)
- {
- this.fpSpread1.Sheets[0].Cells[i, j].CellType = btnDelCellType;
- }
- }
- this.fpSpread1.Sheets[0].ColumnHeader.Cells[0, 1].ColumnSpan = 2;
- this.fpSpread1.Sheets[0].ColumnHeader.Cells[0, 1].Text = "操作";
- }
- private void CustomizeButtonVisible()
- {
- this.fpSpread1.Sheets[0].Cells[0, 1].ResetCellType();
- }
复制代码 |