DatePickerFor in grid - validation problem

2 posts, 0 answers
  1. Ján Horník
    Ján Horník avatar
    9 posts
    Member since:
    Oct 2009

    Posted 25 Aug 2014 Link to this post

    Hi,
    I have problem with kendo date validation in kendo grid.

    I have EditorTemplate in column in kendoGrid:
    columns.Bound(p => p.DatumVznikuKontraktu).EditorTemplateName("Date").ClientTemplate("#= kendo.toString(DatumVznikuKontraktu, 'd') #" +<br>"<input type='hidden' name='ZamKontrakts[#= index(data)#].DatumVznikuKontraktu' value='#= nullTest(DatumVznikuKontraktu) #' />").HeaderHtmlAttributes(new { style = "white-space:pre-wrap; vertical-align:middle" });

    EditorTemplate Date:

    <%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<DateTime?>" %>
     
    <%: Html.Kendo().DatePickerFor(m => m)
            .Format(LanguageResources.Resource.DateFormat)
            .Culture(System.Threading.Thread.CurrentThread.CurrentCulture.ToString())
            %>

    Culture is SK-sk (slovakia). DateFormat - dd.MM.yyyy

    When I change a date in grid I get validation error message: The field DatumVznikuKontraktu must be a date. 

    Can you help me ? 

    Thx


  2. Georgi Krustev
    Admin
    Georgi Krustev avatar
    3707 posts

    Posted 27 Aug 2014 Link to this post

    Hello Ján,

    I believe that the problem is related to jQuery Validate and its inability to validate internalized dates. I would suggest you check this troubleshooting topic and the step-by-step validation tutorial.
    Let me know if something is unclear and I can assist.

    Regards,
    Georgi Krustev
    Telerik
     

    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. UI for ASP.NET MVC is VS 2017 Ready
Back to Top