I am using the Infragistics4.WebUI.UltraWebGrid.v10.2, Version=10.2.20102.1011. The grid is bound to a datasource. Some of the data that comes out of the database is in the DateTime format. The database is Sql Server 2008.
The grid I am using allows for Insert/Update. It also lets you Insert/Update the columns containing the date and time. The UltraGridColumns that contain the date and time are set up with Format="dd/MM/yyyy" so that only the day, month and year are visible to the user.
When the user clicks in the date cell, the cell enters edit mode. At this point, the "dd/MM/yyyy" format is lost. The date comes out looking something like "Fri Jan 01 2010 00:00:00 GMT+1100 (AUS Eastern Daylight Time)" instead of "01/01/2010".
How can the UltraGridColumn be set up in a way that the format of the date and time is always "dd/MM/yyyy", even when the user is editing the cell?
I'm also having this problem. Our columns are built in the page code behind, it's kind of a complicated layout, so I'm not sure how to add the datetimeedit control. Isn't there an accessible property that would dictate the format of the text in the editable cell?
Bump
Hi Lyuba,I have just gotten back from holidays today. Thank you for your reply.This idea didn't work as it threw the following error:"The control WebDateTimeEdit1 references a control that does not implement IProvidesEmbeddableEditor and cannot be used as the editor control for column ..."I am using the Infragistics4.WebUI.UltraWebGrid.v10.2, Version=10.2.20102.1011 grid control.
Please advise.
Thanks.
Hello BendigoIT,
Let us know if you need further assistance with this matter.
Regards,
Lyuba
Developer Support Engineer
Infragistics
www.infragistics.com/support
If you would like to format the datetime that is displayed when the cell is in edit mode, you should use WebDateTimeEdit, and set the formatting to it:
<igtxt:webdatetimeedit id="WebDateTimeEdit1" runat="server" Width="106px" EditModeFormat="dd/MM/yyyy " DisplayModeFormat="dd/MM/yyyy"></igtxt:webdatetimeedit>
Then you should set this editor to be used when the cells from this column are in edit mode:
<igtbl:UltraGridColumn EditorControlID="WebDateTimeEdit1" Format="dd/MM/yyyy"…
Hope this helps.