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

Hi,
I am using the DatePickerFor Helper in MVC 5.
I am putting it in a page with a Grid.
I Noticed that when the Unobtrusive Support is turned off, it renders as a simple textbox and not as the DatePicker.
Now I am using the disabled Unobtrusive only for showing data on the Hierarchical grid i specified in another post today, and then when it will be resolved I'll switch back to that behavior, but it seems strange to me that it won't work. I have seen hat this helper works in your examples, and when I have checked the sources I have seen that the property in Web.COnfig is set fo False.

Maybe there is a conflict between the two controls in the same page?

    Thanks in advance

   Andrea Perazzolo

5 Replies

KS Kaliswaran Shanmuga Sundaram Syncfusion Team January 8, 2015 12:49 PM UTC

Hi Andrea,

Sorry for the Inconvenience caused.

We have analyzed the reported issue (When the Unobtrusive Support is turned off, the DatePickerFor renders as a simple textbox and not as the DatePicker) and we are not able to reproduce it.

We have prepared a simple sample based on your requirement. You can also download the attached sample from the following location.

Sample: Sample

In the above sample, we have used the DatePickerFor with the form. When we submit the form the selected date value is send in postback. The submitted date value displayed in the view page.

We have also tried this with the grid sample. In this sample also we cannot reproduce the above reported issue. Both the controls are working fine.

If you still face any problems, please revert back us the attached sample with replication procedure. So that we could provide the exact solution at earliest.

Please let us know if you have any queries.

Regards,

Kaliswaran S



AP Andrea Perazzolo January 9, 2015 11:05 AM UTC

I am able to reproduce the problem even in your example, changing a little the code:

public class Incident
{
    public Incident()
    {
        TempContainer = new Container();
    }
 
    DateTime dt = DateTime.Now;
 
    public DateTime datepicker1
    {
        get;
 
        set;
 
    }
 
    public Container TempContainer { getset; }
 
}
 
public class Container
{
    public DateTime TempDate { getset; }
 
    public Container()
    {
        TempDate = DateTime.Now.AddMonths(2);
    }
}

I have put a DateTime property inside another class

<div class="datepickerDiv">
    @Html.EJ().DatePickerFor(model => model.datepicker1, (Syncfusion.JavaScript.Models.DatePickerProperties)ViewData["date"])
</div>
 
<div class="datepickerDiv">
    @Html.EJ().DatePickerFor(model => model.TempContainer.TempDate, (Syncfusion.JavaScript.Models.DatePickerProperties)ViewData["date"])
</div>
The First DatePicker renders correctly, the seconnd is a simple Textbox

  Andrea Perazzolo






KS Kaliswaran Shanmuga Sundaram Syncfusion Team January 12, 2015 12:28 PM UTC

Hi Andrea,

Sorry about the Inconvenience caused.

We are able to reproduce the reported issue (When I use two DatePickerFor in same page with different Properties, The first DatePicker renders correctly, the second is a simple Textbox). We have confirmed this as a defect and an issue report has been logged for this. Fix for this issue will be available in our upcoming service pack release for ASP.NET MVC which is expected to be rolled out at the end of this month (January 2015). We will notify you once our service pack release is rolled out.

If you are in need of a solution sooner, then please let us know about this. So that we could provide a patch for this issue before service pack release.

Please let us know if you have any queries.

Regards,

Kaliswaran S



AP Andrea Perazzolo January 15, 2015 04:29 PM UTC

Hi,
I just noticed that the DatePickerFor problem appears even on the DropDownListFor
Maybe is a more general problem that happens with Other MVC Helpers.

    Andrea Perazzolo


KS Kaliswaran Shanmuga Sundaram Syncfusion Team January 19, 2015 12:54 PM UTC

Hi Andrea,

Thanks for your update.

Query: I just noticed that the DatePickerFor problem appears even on the DropDownListFor. Maybe is a more general problem that happens with Other MVC Helpers.

We have already validated the above reported issue for all “Form” controls not only for “DataPickerFor” and we will deliver the fix for all “Form” controls.

Please let us know if you have any queries.

Regards,

Kaliswaran S

Loader.
Live Chat Icon For mobile
Up arrow icon