Plugin System Setting Date Time not just Date  Topic is solved

Discussions relating to Jiwa 7 plugin development, and the Jiwa 7 API.

Plugin System Setting Date Time not just Date

Postby SBarnes » Tue Jan 12, 2021 9:56 am

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?
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1696
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 191

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

Postby Scott.Pearce » Tue Jan 12, 2021 10:27 am

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;
      }
Scott Pearce
Senior Analyst/Programmer
Jiwa Financials
User avatar
Scott.Pearce
Senpai
Senpai
 
Posts: 765
Joined: Tue Feb 12, 2008 11:27 am
Location: New South Wales, Australia
Topics Solved: 230

Re: Plugin System Setting Date Time not just Date

Postby SBarnes » Tue Jan 12, 2021 10:38 am

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?
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1696
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 191

Re: Plugin System Setting Date Time not just Date

Postby Scott.Pearce » Tue Jan 12, 2021 10:58 am

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.
Scott Pearce
Senior Analyst/Programmer
Jiwa Financials
User avatar
Scott.Pearce
Senpai
Senpai
 
Posts: 765
Joined: Tue Feb 12, 2008 11:27 am
Location: New South Wales, Australia
Topics Solved: 230


Return to Technical and or Programming

Who is online

Users browsing this forum: No registered users and 3 guests