Hi.
I have a webdatagrid that is binding to a dataset. When I edit a datetime cell in my webdatagrid, It stores this value substracting 2 hours from the time I have entered. For example. if I enter 7/24/2011 09:00, the webdatagrid changes this value to 7/24/2011 07:00.
Here is my webdatagrid code:
<
runat="server"
Width="100%"
="true" EnableEmbeddedJavaScript="true" DataKeyFields="RegID"
DropDownCalendarID="webMonthCalendar" runat="server" OpenCalendarOnFocus
="true">
</ig:WebDataGrid>
Can you help me, please? Thanks.
Did you ever get an answer to this? I have a similar problem. I've got a grid with datetime columns tied to DatePickerProviders, but with no DropDownCalendarID specified (if I attempt to specify a DropDownCalendarID, the grid blows up with the evil "Multiple controls have the same ID" error). Anyway, in my situation, the DatePickerProvider returns a date that is offset depending on whether the user's computer is in a different timezone from the server. If the user and server are in the same timezone, there is no offset. But if the user and server are in different timezones, it is offset based on the difference.
For example, if the server is in Central US time zone and the user is in the Eastern US time zone, and the user chooses the date "8/2/2011", then the DatePickerProvider returns "8/1/2011 11:00 PM". Why? I have no idea. Note that a stand alone WebDatePicker on the same page does NOT do this. It returns the same date (with no time) that the user selected.
Since our application is used globally, this is a huge problem for us.
you should add DataFormatString="{0:dd/MM/yyyy}" this to client side on date boundfield.
it sets default date format. and on server side DateTimeColumn = DateTime.UtcNow.Date