Posted 8 October 2017, 6:14 pm EST
Hello,
- This case is not bug of Spread. We only support below list for datetime format:-
char[] dateChars = { 'd', 'M', 'y' };
char[] timeChars = { 'h', 'm', 's' };
Although .Net support more datetime format like:- F, f, g, t, z but Spread don’t support them directly. If you want to use these formats then please use the workaround below:-
FarPoint.Win.Spread.CellType.DateTimeCellType dt = new FarPoint.Win.Spread.CellType.DateTimeCellType();
dt.DateTimeFormat = FarPoint.Win.Spread.CellType.DateTimeFormat.UserDefined;
dt.UserDefinedFormat = "";
fpSpread1.ActiveSheet.Cells[0, 0].CellType = dt;
fpSpread1.ActiveSheet.Columns[0].Width = 130;
fpSpread1.ActiveSheet.Cells[0, 0].Value = System.DateTime.Now;
String FromDate = ((DateTime)(fpSpread1.ActiveSheet.Cells[0, 0].Value)).ToString("HH:mm:ss.fff");
dt.UserDefinedFormat = FromDate;
Hope it helps.
Thanks,
Reeva