Page 1 of 1

Plugin System Setting Date Time not just Date

PostPosted: Tue Jan 12, 2021 9:56 am
by SBarnes
Is there a way to make as Plugin System Setting and/or a custom setting be a full Date and Time and not Just a Date?

Re: Plugin System Setting Date Time not just Date  Topic is solved

PostPosted: Tue Jan 12, 2021 10:27 am
by Scott.Pearce
Put this in the FormatCell method of the plugin to make the cell include time:

Code: Select all
      if(CustomField.PluginCustomField.Name == "MyDateTimeField")
      {
         FarPoint.Win.Spread.CellType.DateTimeCellType myDateTimeFieldCell = (FarPoint.Win.Spread.CellType.DateTimeCellType)GridObject.ActiveSheet.Cells[Row, Col].CellType;
         myDateTimeFieldCell.DateTimeFormat = FarPoint.Win.Spread.CellType.DateTimeFormat.ShortDateWithTime;
      }

Re: Plugin System Setting Date Time not just Date

PostPosted: Tue Jan 12, 2021 10:38 am
by SBarnes
Thanks Scott,

That works to a certain extent but is there a way for when you double click in the cell and the control comes up to let you specify the time and the date rather than just the date?

Re: Plugin System Setting Date Time not just Date

PostPosted: Tue Jan 12, 2021 10:58 am
by Scott.Pearce
That's really a question for FarPoint/GrapeCity. JiwaGrid is actually a Spread for Windows Forms. Their forums are here and the product documentations is here.

It appears as though you can set a few options on the DateTime cell type to make data entry a little easier such as "SpinButton" = true. However, the type of dialog to display when double clicking on the cell seems to be fixed such that the day calendar is always used when a date is involved, and a clock dialog is used when the cell is time-only. It may be possible to create your own "SubEditor" (this is what they call the dialogs that appear when you double click a cell) and use that instead of the in-built ones.