最简单的方案是重写 PaintCell ,绘制的时候改变以下, 或者重写format
MyFormatCellType ct = new MyFormatCellType();
fpSpread1.ActiveSheet.Cells[3, 2].CellType = ct;
fpSpread1.ActiveSheet.Cells[3, 2].Formula = "A1";
public class MyFormatCellType : FarPoint.Win.Spread.CellType.GeneralCellType
{
public override void PaintCell(Graphics g, Rectangle r, FarPoint.Win.Spread.Appearance appearance, object value, bool isSelected, bool isLocked, float zoomFactor)
{
var text = value == null ? "" : value + " 元整";
base.PaintCell(g, r, appearance, text, isSelected, isLocked, zoomFactor);
}
} |