回复 1楼holly.huang的帖子
需要设置 DateTimeCellType 的 FormatString 属性,请使用以下代码测试:
- FarPoint.Web.Spread.DateTimeCellType dt = new FarPoint.Web.Spread.DateTimeCellType();
- System.Globalization.DateTimeFormatInfo dtf = new System.Globalization.DateTimeFormatInfo();
- dtf.ShortTimePattern = "HH:mm:ss";
- dt.DateTimeFormat = dtf;
- dt.FormatString = "HH:mm:ss";
- dt.MaximumValue = new DateTime(2020, 12, 31, 10, 10, 10);
- dt.MinimumValue = new DateTime(1950, 1, 1, 10, 10, 10);
- FpSpread1.ActiveSheetView.Cells[0, 0].CellType = dt;
- FpSpread1.ActiveSheetView.Cells[0, 0].Value = DateTime.Now;
复制代码 |