Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
40
Editing datetime cell saves a wrong value in the grid...
posted

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:

 

<

ig:WebDataGrid ID="wdgLoadingUnloadingDetails"

 

 

 

runat="server"

 

 

 

Width="100%"

 

 

 

 

AutoGenerateColumns="false" EnableAjax="true" EnableAjaxViewState="true"

 

 

 

 

EnableViewState="true" EnableDataViewState

="true" EnableEmbeddedJavaScript="true" DataKeyFields="RegID"

 

 

 

OnRowUpdating="wdgLoadingUnloadingDetails_RowUpdating">

 

 

 

<EditorProviders>

 

 

 

<ig:DatePickerProvider ID="wdgLoadingUnloadingDetails_DateInputProvider">

 

 

 

<EditorControl ID="wdgLoadingUnloadingDetails_ec_DateInputProvider"

 

 

 

DropDownCalendarID="webMonthCalendar" runat="server" OpenCalendarOnFocus

="true">

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

</EditorControl>

 

 

 

</ig:DatePickerProvider>

 

 

 

</EditorProviders>

 

 

 

<Columns>

 

 

 

<ig:BoundDataField DataFieldName="RegID" Key="RegID" Hidden="true"></ig:BoundDataField>

 

 

 

<ig:BoundDataField Width="140px" DataFieldName="LocationName" Key="LocationName" Header-Text="<%$ Resources:AssignTransportData, Place %>"></ig:BoundDataField>

 

 

 

<ig:BoundDataField Width="100%" DataFieldName="StreetName" Key="StreetName" Header-Text="<%$ Resources:AssignTransportData, Address %>"></ig:BoundDataField>

 

 

 

<ig:BoundDataField Width="140px" DataFieldName="City" Key="City" Header-Text="<%$ Resources:AssignTransportData, City %>"></ig:BoundDataField>

 

 

 

<ig:BoundDataField Width="30px" DataFieldName="PostalCode" Key="PostalCode" Header-Text="<%$ Resources:AssignTransportData, PostalCode %>"></ig:BoundDataField>

 

 

 

<ig:BoundDataField Width="60px" DataFieldName="Reference" Key="Reference" Header-Text="<%$ Resources:AssignTransportData, Reference %>"></ig:BoundDataField>

 

 

 

<ig:BoundDataField Width="86px" DataType="System.DateTime" DataFormatString="<%$ Resources:AssignTransportData, DataFormatString %>" DataFieldName="ProposedByContractingCompany" Key="ProposedByContractingCompany" Header-Text="<%$ Resources:AssignTransportData, RequestedDate %>"></ig:BoundDataField>

 

 

 

<ig:BoundDataField Width="86px" CssClass="Editable" DataType="System.DateTime" DataFormatString="<%$ Resources:AssignTransportData, DataFormatString %>" DataFieldName="Actual" Key="Actual" Header-Text="<%$ Resources:AssignTransportData, RealDate %>"></ig:BoundDataField>

 

 

 

</Columns>

 

 

 

<Behaviors>

 

 

 

<ig:EditingCore AutoCRUD="true">

 

 

 

<Behaviors>

 

 

 

<ig:CellEditing EditModeActions-EnableF2="true" EditModeActions-EnableOnKeyPress="true" EditModeActions-MouseClick="Single" EditModeActions-EnableOnActive="true">

 

 

 

<ColumnSettings>

 

 

 

<ig:EditingColumnSetting ColumnKey="RegID" ReadOnly="true" />

 

 

 

<ig:EditingColumnSetting ColumnKey="LocationName" ReadOnly="true" />

 

 

 

<ig:EditingColumnSetting ColumnKey="StreetName" ReadOnly="true" />

 

 

 

<ig:EditingColumnSetting ColumnKey="City" ReadOnly="true" />

 

 

 

<ig:EditingColumnSetting ColumnKey="PostalCode" ReadOnly="true" />

 

 

 

<ig:EditingColumnSetting ColumnKey="Reference" ReadOnly="true" />

 

 

 

<ig:EditingColumnSetting ColumnKey="ProposedByContractingCompany" ReadOnly="true" />

 

 

 

<ig:EditingColumnSetting ColumnKey="Actual" ReadOnly="false" EditorID="wdgLoadingUnloadingDetails_DateInputProvider" />

 

 

 

</ColumnSettings>

 

 

 

</ig:CellEditing>

 

 

 

</Behaviors>

 

 

 

</ig:EditingCore>

 

 

 

</Behaviors>

</ig:WebDataGrid>

Can you help me, please? Thanks.

Parents
  • 320
    posted

    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.

Reply Children