We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Datetime picker format after saving

Hi,

I am using a Grid with an editable date column and when I edit the field and save the date format changes:


I am struggling with this, really appreciate the support,

Thanks in advance


5 Replies

MS Madhu Sudhanan P Syncfusion Team December 5, 2018 10:23 AM UTC

Hi Laura, 

Thanks for contacting Syncfusion support. 

Could you please check and address the below queries which help us to analyze further on the reported problem. 

1.       Share the grid package version 
2.       Share the type of data binding used. [Local using viewbag or remote binding using controller action] 
3.       Share the grid rendering code to check column and edit type used. 
4.       If you have used remote data binding then please share the network tab while saving record to check request and its response. 
5.       Also any information that you find valuable for us to analyze further. 

Regards, 
Madhu Sudhanan P   



LJ Laura Jordan January 14, 2019 07:40 PM UTC

Hi Madhu,

Thanks for your replay, here is the information you requested:

1.       Share the grid package version: 
Version=14.1400.0.46
2.       Share the type of data binding used. [Local using viewbag or remote binding using controller action] :
Local binding via ViewBag (Datasource(ds => ds.Json((IEnumerable)ViewBag.MasterData).BatchURL("BatchUpdateAnexo").Adaptor(AdaptorType.RemoteSaveAdaptor)))
3.       Share the grid rendering code to check column and edit type used:
col.Field("Vencimiento").HeaderText("Vencimiento").EditType(EditingType.Datepicker).Format("{0:MM/dd/yyyy}").TextAlign(TextAlign.Center).Width(200).CssClass("myHeader").HeaderTextAlign(TextAlign.Left).AllowEditing(true).Add();
4.       If you have used remote data binding then please share the network tab while saving record to check request and its response:
I am not using remote data binding
5.       Also any information that you find valuable for us to analyze further. :
I attach my view an controller code

Thanks for the support!

Attachment: code_12f5e39c.rar


VN Vignesh Natarajan Syncfusion Team January 16, 2019 11:58 AM UTC

Hi Laura, 
 
Thanks for the update. 
 
We have prepared a sample using your code example in version 14.1.0.46 but we are unable to reproduce the reported issue at our end. Kindly download the sample from below link 
 
 
From you code example, we have found that you have not enabled IsPrimaryKey property to any of available column which has unique values. Refer our Knowledge base document on PrimaryKey for your reference 
 
 
If you still  face the issue, kindly try to reproduce the reported issue in provided sample and get back to us.   And also share the details regarding action performed in client side events.  
 
Note: In the server side, you have used DateTime.ParseExact .Kindly share more details regarding that conversion. Because while returning from the DatePicker, value will be in form of DateObject.  
 
Regards,
Vignesh Natarajan
 



LJ Laura Jordan January 16, 2019 06:29 PM UTC

Hi Vignesh,

Thanks for your replay.

I was unable to execute the example that you send me, it shows me some compilation errors:



I still getting the same issue with the edition of the date field.
In the server side I am using DateTime.ParseExact because the date format that I get from the view is like: ddd MMM dd yyyy HH:mm:ss 'GMT-0600 (Central Standard Time).  :(



Also in the view I am getting the same date format, despite of the format string:

col.Field("Vencimiento").HeaderText("Vencimiento").EditType(EditingType.Datepicker).Format("{0:MM/dd/yyyy}").TextAlign(TextAlign.Center).Width(200).CssClass("myHeader").HeaderTextAlign(TextAlign.Left).AllowEditing(true).Add();

Appreciate the support,

Thanks!



VN Vignesh Natarajan Syncfusion Team January 17, 2019 11:22 AM UTC

Hi Laura, 
 
Sorry for the inconvenience caused. 
 
Query 1: I was unable to execute the example that you send me, it shows me some compilation errors: 
 
The reported error will occur if the dll’s assemblies are not referenced properly in the sample. You have to refer the dll’s that are installed in the system and the assembly details can be found from the following installed location. 
“<Installed Location>\Syncfusion\Essential Studio\14.1.0.46\precompiledassemblies” 
 
After adding the Syncfusion assemblies you have to update the version of the web.config file . 
 
Refer the below link for knowledge base documentation, 
 
 
Query 2: I still getting the same issue with the edition of the date field. 
 
We are unable to reproduce the reported issue at our end. After editing the date value on clicking the save button will call Batch Url along with changed value. In server side,  modified date value is returned without TimeZone. But in your sample date value is retuned with time zone. 
   
Refer the below screenshot,  
 
 
 
 
 
Still facing the issue please get back to us, with following details. 
 
  1. From the shared screenshot, we could see that the date value (yours) is received with timezone. So, please confirm whether are you changing the date value in the client side using any events. If yes, please share the details. Also share the code related to client side events.
  2. Share the video demo of the issue.
  3. If possible reproduce reported issue in the provided sample and revert back to us.
 
 
Regards, 
Vignesh Natarajan. 


Loader.
Live Chat Icon For mobile
Up arrow icon