回复 1楼iceman的帖子
可以通过设置 DateTimeCellType 来实现日期类型的验证:
- FarPoint.Web.Spread.DateTimeCellType dt = new FarPoint.Web.Spread.DateTimeCellType();
- System.Globalization.DateTimeFormatInfo dtf = new System.Globalization.DateTimeFormatInfo();
- dtf.LongDatePattern = "D";
- dtf.ShortDatePattern = "M/d/yyyy";
- dt.DateTimeFormat = dtf;
- dt.MaximumValue = new DateTime(2020, 12, 31);
- dt.MinimumValue = new DateTime(1950, 1, 1);
- FpSpread1.ActiveSheetView.Cells[0, 0].CellType = dt;
- FpSpread1.ActiveSheetView.Cells[0, 0].Value = DateTime.Now;
复制代码 |