这个看您的需求,有几个方案可行,
1. 重写celltype,当值为0是什么都不显示
- <br />public class MyGeneralCellType : GeneralCellType
- <br />{
- <br /> public override void PaintCell(System.Drawing.Graphics g, System.Drawing.Rectangle r, FarPoint.Win.Spread.Appearance appearance, object value, bool isSelected, bool isLocked, float zoomFactor)
- <br /> {
- <br /> if (value is double && (double)value == 0.0)
- <br /> value = null;
- <br /> base.PaintCell(g, r, appearance, value, isSelected, isLocked, zoomFactor);
- <br /> }
- <br />}
复制代码
2. 在事件中处理,entercell时候给单元格赋0值,LeaveCell时候删除0 |