We have a requirement where the date-time should appear in MM/DD/YYYY HH:MM:SS (24 hr) format in the UltraWinGrid in a bound coulmn of data type DateTime.
eg. 05/21/2008 23:45:00
We have tried with the given formats and Styles.
Trying to modify some of the existing formats (tried with {LOC}mm/dd/yyyy hh:mm:ss and mm/dd/yyyy hh:mm:ss) gave some unexpected results, the entered time (23:45:00) got changed to 11:45:00 (AM/PM format but did not display "PM").
Thanks in advance.
Go into your column properties for that Date column and add/change this:
Format (property): MM/dd/yyyy HH:mm:ss
MaskInput (property): {LOC}mm/dd/yyyy hh:mm:ss
Thanks for the solution, but we faced a problem. The given solution works when we tab out or click any where else, but clicking on the cell again makes the time come in 12 hour format (without AM/PM). e.g. DateTime given: 05/21/2000 23:45:01 DateTime on tabout: 05/21/2000 23:45:01 DateTime on cell activation: 05/21/2000 11:45:01 DateTime on tabout again: 05/21/2000 23:45:01 This happens when the particular cell is activated again. On tabbing out, the cell displays time again in 24 hr format. Can you help us with this problem? Thanks in advance.
Hi Infragistics,
It works now. Thanks for supporting.
Hello,
This might be because the 'DataType' of your column is not 'DateTime'. Try setting the type to 'DateTime' and also please take a look at the following two properties:http://help.infragistics.com/Help/NetAdvantage/WinForms/2011.2/CLR2.0/HTML/Infragistics2.Win.UltraWinGrid.v11.2~Infragistics.Win.UltraWinGrid.UltraGridColumn~DataType.html
http://help.infragistics.com/Help/NetAdvantage/WinForms/2011.2/CLR2.0/HTML/Infragistics2.Win.UltraWinGrid.v11.2~Infragistics.Win.UltraWinGrid.UltraGridColumn~Format.html
http://help.infragistics.com/Help/NetAdvantage/WinForms/2011.2/CLR2.0/HTML/Infragistics2.Win.UltraWinGrid.v11.2~Infragistics.Win.UltraWinGrid.UltraGridColumn~MaskInput.html
Please do not hesitate to ask if something comes up.
Hi Mike,
I have a problem when UltraGrid NOT in Edit Mode, my date time display as a number.
Example: I have inputed 01/31/2012, but NOT in Edit Mode, it displayed 01312012.
What did I wrong? Please help, thanks.
Hi,
I managed to get this sorted by setting the MaskInput to '{date} {longtime}'
Hope this helps!
I also have this problem. Is the functionality to display consistently the date time format as 'MM/dd/yyyy HH:mm:ss' with or without focus not supported by Infragistics?