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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

2 questions for DateTimePicker

Thread ID:





123242 Feb 29,2016 02:54 PM UTC Mar 2,2016 08:47 AM UTC ASP.NET MVC 4
Tags: DateTimePicker
Emil Yotov
Asked On February 29, 2016 02:54 PM UTC

I have 2 questions for DateTimePicker:

1. When the value is oblivious to what is the date , and always puts the current date.

DateTime dt = new DateTime(2016,3,4,13,22);
@Html.EJ().DateTimePicker("DATE_START").DateTimeFormat("dd.MM.yyyy HH:mm").Value(dt)

2. I have a page that present 2 DateTimePicker and a button to open the Dialog. When open the Dialog in Ajax mode and his subsequent closing , DateTimePicker clears specified dates and does not show anything.

thank you

Gobalakrishnan S [Syncfusion]
Replied On March 1, 2016 02:47 PM UTC

Hi Emil Yotov,
Query: Value is oblivious to what is the date, and always puts the current date.

We were able to reproduce the problem and we considered “The datetimepicker control displays only the current date” as bug. A support incident to track the status of this defect has been created under your account. Please log on to our support website to check for further updates.


Query:  DateTimePicker clears specified dates and does not show anything.

We have analyzed your query, the reported issue may be caused if you have to rendered the DateTimePicker control in unobtrusive mode, and used the “ej.widget.init ()” to initialize the datetimepicker control in the Ajax Success. 

If you are using the “ej.widget.init ()” method, then it should be called only at the initial time of dialog open only .no need to initialize the widgets whenever the open is triggered.  So in this case, we can maintain the flag variable to identify the initial rendering and prevent the multiple execution of “ej.widget.init ()” method to resolve this issue. We have prepared the sample based on your requirement please find the sample on below location.


Whether you are mentioned this issue? Or any other issue. If we have misunderstood means, please provide the more details about the issue with code snippet. This will help us to provide the exact solution to resolve your issue.

Please let me know, if you have mentioned concern


Gobalakrishnan S

Emil Yotov
Replied On March 1, 2016 03:20 PM UTC

I use “ej.widget.init ()” to initialize the datetimepicker control in the Ajax Success. 

    var initial = true;
    function onSuccess(args) {
        if (initial)

I put initial var in main code.
In main code DATETIME PICKER is in Index.cshtml file, not in Dialog. In Dialog a have use other Syncfusion control twat show well. Problem is re-initialization on controls in Index.cshtml where is DATETIME PICKERS /or other controls/.
How to prevent re-init on control in Index.cshtml after close dialog?

Emil Yotov
Replied On March 1, 2016 04:41 PM UTC

Problem solved.

 var initial = true;
    function onSuccess(args) {
        if (initial)


Selvamani Sankarappan [Syncfusion]
Replied On March 2, 2016 08:47 AM UTC

Hi Emil,

Thanks for the update,

Please let us know, if you need any further assistance. We will be happy to help you.


Selvamani S


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon