回复 5楼sakeryu的帖子
请尝试以下代码:
- protected void Page_Load(object sender, EventArgs e)
- {
- if (IsPostBack)
- {
- return;
- }
- this.FpSpread1.ActiveSheetView.Cells[0, 0].Value = 0;
- this.FpSpread1.ActiveSheetView.Columns[0].CellType = new MyDoubleCellType();
- }
- [Serializable]
- public class MyDoubleCellType : FarPoint.Web.Spread.DoubleCellType
- {
- public override string Format(object obj)
- {
- if ((obj==null)||(Convert.ToDouble(obj)==0))
- {
- return "";
- }
- else
- {
- return base.Format(obj);
- }
- }
- }
复制代码 |