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.
Unfortunately, activation email could not send to your email. Please try again.

2 questions for DateTimePicker

Thread ID:

Created:

Updated:

Platform:

Replies:

123242 Feb 29,2016 09:54 AM Mar 2,2016 03:47 AM ASP.NET MVC 4
loading
Tags: DateTimePicker
Emil Yotov
Asked On February 29, 2016 09:54 AM

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 09:47 AM

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.

https://www.syncfusion.com/account/login?ReturnUrl=/support/directtrac/incidents


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.

http://www.syncfusion.com/downloads/support/forum/123242/ze/MvcApp11244903495

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

Regards,

Gobalakrishnan S


Emil Yotov
Replied On March 1, 2016 10:20 AM

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

    var initial = true;
    function onSuccess(args) {
        if (initial)
        {
            ej.widget.init();
        }
    }


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 11:41 AM

Hi,
Problem solved.

 var initial = true;
    function onSuccess(args) {
        if (initial)
        {
            ej.widget.init($("#div_relation_all"));  
        }


Thanks.


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

Hi Emil,

Thanks for the update,

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

Regards,

Selvamani S


CONFIRMATION

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.

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.

;