Problem with date format

2 posts, 0 answers
  1. Jayraj
    Jayraj avatar
    2 posts
    Member since:
    Aug 2012

    Posted 18 Mar 2013 Link to this post

    Hi,

    In my model I have the following property:
    /// <summary>
     /// Get or set property for EffDt property.
     /// </summary>
     [DataMember]
    [UIHint("EffDateEditor")]
    public DateTime? EffDt { get; set; }

    whereas my editor template is as follows:
    @model DateTime?
    @(Html.Kendo().DatePickerFor(m => m).Format("dd-MMM-yyyy"))

    Lastly my grid partial has the following:
    columns.Bound(p => p.EffDt)
                        .Format("{0:dd-MMM-yyyy}")
                        .Title("Effective Date")
                        .Sortable(false)
                        .Filterable(false)
                        .Width(120);

    Now whether I add new data or edit existing data the date column is always throwing validation error as can be seen in the attached file.

    Please help this is urgent.
  2. Vladimir Iliev
    Admin
    Vladimir Iliev avatar
    2172 posts

    Posted 19 Mar 2013 Link to this post

    Hi Jayraj,

     
    Most probably the culture of the project is not set correctly - please note that the culture on the client side should be equal to the culture on the server - that way the grid will send the data in format that will be understand by the Default MVC Model binder. I would suggest to check the Grid Globalization demo which shows example of how to correctly setup your project to have equal culture on both the client and the server. You can find this demo in the offline examples which comes with KendoUI for ASP.NET MVC installation.

    Kind Regards,
    Vladimir Iliev
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. UI for ASP.NET MVC is VS 2017 Ready
Back to Top