michael 你好,可以通过继承 doublecelltype 实现自定义单元格类型实现,请参考代码:
- public partial class WebForm1 : System.Web.UI.Page
- {
- protected void Page_Load(object sender, EventArgs e)
- {
- MyCellType test = new MyCellType();
- this.FpSpread1.ActiveSheetView.Columns[0].CellType = test;
- }
- }
- [Serializable]
- public class MyCellType:FarPoint.Web.Spread.DoubleCellType
- {
- public override Control PaintCell(string id, TableCell parent, FarPoint.Web.Spread.Appearance style, FarPoint.Web.Spread.Inset margin, object value, bool upperLevel)
- {
- if (value == null)
- {
- value = "0.000";
- }
- return base.PaintCell(id, parent, style, margin, value, upperLevel);
- }
- }
复制代码 |