DatePickerFor not using model attributes

3 posts, 0 answers
  1. Michael
    Michael avatar
    46 posts
    Member since:
    Dec 2010

    Posted 23 Sep 2014 Link to this post

    I have the Required attribute on my model, but when I use DatePickerFor, Kendo Validator does not pick that up.  If I use the F12 tools and manually add "required='required'" to the input that the DatePicker renders, then Validator picks it up and shows a message next to the picker.  Besides that, it's also not picking up the ErrorMessage on my Required attribute.  I'm assuming I could add another attribute to the <input> for it to pick that up as well, but not yet sure what the attribute name is.  Can you please explain why I can't just get this behavior out of the box, and if this is a bug with the DatePickerFor?  I'd rather not have to use .HtmlAttributes to manually stick these things onto every DatePicker.  Maybe I'm just missing something, but for something like this, you expect it to just work.  Thanks!
  2. Atanas Korchev
    Atanas Korchev avatar
    8462 posts

    Posted 25 Sep 2014 Link to this post

    Hi Michael,

    Does this work with Html.TextBoxFor? If it doesn't then probably you are not using Html.Form. 

    If it does work with Html.TextBoxFor we would like to see a runnable project that shows the problem. You could prepare one and attach it here.

    Atanas Korchev

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

  3. Michael
    Michael avatar
    46 posts
    Member since:
    Dec 2010

    Posted 29 Sep 2014 in reply to Atanas Korchev Link to this post

    Sorry for the delay.  We use another helper (TwitterBootstrapMVC) around yours in order to get Bootstrap styling for our form elements, and it appears to be related to that instead.  I have sent a demo project to the developer of that project to see if they can assist further.  Thanks!
Back to Top