Hi,
I have created dynamic web date picker in my application. i select the date (05/26/2017 12:00:00 AM ) , after the post back it get changed as ( 05/25/2017 06:30:00 PM).
Note : if i set the machine time zone Central time (US & CANADA) means it's working fine, after the post back date not changed in web date picker.
If I set other time zone means issue will come,
Review my code and kindly give the solution for this issue.
wdcDateColumn = new WebDatePicker(); wdcDateColumn.Width = Unit.Pixel(115); wdcDateColumn.ID = columnName; wdcDateColumn.BackColor = Color.White; System.Globalization.CultureInfo ci = System.Globalization.CultureInfo.CreateSpecificCulture("en-US"); ci.DateTimeFormat.LongDatePattern = datePreference; ci.DateTimeFormat.ShortDatePattern = datePreference; wdcDateColumn.Culture = ci; wdcDateColumn.Nullable = true; wdcDateColumn.ClientSideEvents.ValueChanged = "AssignModifiedDate"; container.Controls.Add(wdcDateColumn); wdcDateColumn.NullText = String.Empty;
Hello Raja,
In order to ensure that your issue is addressed correctly I will need some more information like:
1. May I know which version of infragistics you are using?2. Which exactly events your application uses to submit form?3. Which browser (version) you are using?
I tried putting your code within page load and on post back the value in the WebdatePicker is displaying correctly.As a container I am using page.form like this :
Page.Form.Controls.Add(wdcDateColumn);
As you are generating control dynamically application should ensure that any dynamic Control does not appear outside of Form. Of in case of aspx, a control should be inside of <form>. Otherwise, that control will not function correctly on client and/or values modified on client will be not passed to server after a postback.
I have created a sample application to test the behavior using version 16.2.20162.1023 with culture ‘en-US’ and ‘es-ES’ and did not able to reproduce the issue, please find the attached sample for your reference.
Or, if this sample project is not an accurate demonstration of what you're trying to do, please feel free to modify it and send it back for further investigation.
Please note as US office is closed on Monday (05/29/2017) so I will be able to provide you my update on Tuesday(05/29/2017) .
Hai Divya,
Thanks for your response.
My infragistics version is :14.2.20142.2092
Event : Button onclick event
Browser : IE8
I am also tried that in page load, it's working fine. but when i am using container as webdatagrid cell. then only issue will come. i thing may be UTC Date issue, the date value is changed to - 5.30 hours. Kindly give me solution.
Thank you for the update.
Please note that build 2092 for v14.2 doesn't exist so please check the version again and let me know.
Meanwhile I tested the sample with build 2090 / 2590 and still doesn’t able to reproduce the scenario.
The best way for us to assist you is if you provide a small isolated sample where you are trying to set the container as a webdatagrid cell, so that we can run and use for debugging locally
Also I would also recommend you to modify your sample with the latest version 16.2 and check if it resolve the issue.It is because the volume [14.2.20142.*] has already had its last service release so if the resolution of this issue requires a change to the assemblies it will be necessary to upgrade to a more recent volume of Infragistics for [16.2]. You can see our product lifecycle here: <http://www.infragistics.com/support/product-lifecycle>
Hi Divya,
Thanks for your support.
I found the root cause this issue.In my application web date picker value is assigned to web data grid cell. in JavaScript when i retrieve cell value and Re assign to web date picker.
this scenario only we getting the issue because of JavaScript return the browser UTC time format. I just convert that JavaScript date to "MM/dd/yyyy" and assigned to cell.
Now it's working fine.
Regards & Thanks,
Rajasekar
Thank you for the update that your code is working fine now.