DatePicker Loses Its Style After Adding Events

2 posts, 0 answers
  1. Umut
    Umut avatar
    6 posts
    Member since:
    Mar 2015

    Posted 13 Apr 2015 Link to this post

    Hello, 

    I have datepicker in my view as below, But after adding event as http://demos.telerik.com/aspnet-mvc/datepicker/events, it lost its style and looks like Jquery UI datepicker. 

    When i  looked at the source code, without using events, the input type is string and output is like below:

    <span class="k-picker-wrap k-state-default"><input data-val="true" data-val-date="The field Hakediş T. must be a date." data-val-required="The Hakediş T. field is required." id="CmsProgressPaymentDate" name="CmsProgressPaymentDate" style="width: 100%;" type="text" value="13.04.2015" data-role="datepicker" class="k-input k-valid" role="combobox" aria-expanded="false" aria-owns="CmsProgressPaymentDate_dateview" aria-disabled="false" aria-readonly="false"><span unselectable="on" class="k-select" role="button" aria-controls="CmsProgressPaymentDate_dateview"><span unselectable="on" class="k-icon k-i-calendar">select</span></span></span>

    But when i added the onchange or another events, the input type becomes to date and the output as below, 

    <input data-val="true" data-val-date="The field Hakediş T. must be a date." data-val-required="The Hakediş T. field is required." id="CmsProgressPaymentDate" name="CmsProgressPaymentDate" style="width:100%" type="date" value="13.04.2015">

     

    @(Html.Kendo().DatePickerFor(p=>p.CmsProgressPaymentDate)
                .Name("CmsProgressPaymentDate")
                .Value(System.DateTime.Now)
                .HtmlAttributes(new { style = "width:100%" })
    }

  2. Umut
    Umut avatar
    6 posts
    Member since:
    Mar 2015

    Posted 13 Apr 2015 Link to this post

    I am sorry, my mistake. 

     My JS function was faulty.

  3. UI for ASP.NET MVC is VS 2017 Ready
Back to Top