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

Datepickerfor not setting default value

Dear Team,
I am facing issue with datepickerfor , i created a demo project in which  for date field i use datepickerfor and strongly bind  with model and assing Dynamic id to control, for get the change date i use client side event and create a function for get change date , now if i change date in controller i got changed date , but if i dont change date then i get datepicker val empty  

1 Reply

DL Deepa Loganathan Syncfusion Team July 20, 2017 11:33 AM UTC

Hi Ritesh,     
Thanks for contacting Syncfusion support.     
From your query, we suspect that you would like, the Datepicker to be rendered with a default value set from Model and trigger the change event in client side when the DatePicker value changes.   
 We have created a sample based on the requirement and we were not able reproduce the reported issue (empty value received in change event).   
For your convenience, we have updated a sample in the given link.    
Sample   
Also, the change event will be triggered only when the value of the Datepicker changes (in User Interaction or when value is changed in code behind).  
The default value of DatePicker is null. So if no value will be set by default in Datepicker.  
For more details, please follow the below link.    
If this is not the scenario, revert with a modified sample to reproduce the issue, so that we could provide you the prompt response.  
Regards,    
Deepa L.  


Loader.
Up arrow icon