Date editing in Grid where date is yyyy-MM-dd

2 posts, 0 answers
  1. Richard
    Richard avatar
    1 posts
    Member since:
    Jan 2014

    Posted 15 Jan 2014 Link to this post

    I can't get date editing to work within my grid.

    Date formatting is set to yyyy-MM-dd everywhere I can think of

    In the viewmodel I have EstCommenceDate set as follows

    [Required]
    [DataType(DataType.Date)]
    [DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:yyyy-MM-dd}")]
    [Display(ResourceType = typeof(Resources), Name = "OpportunityGridViewModel_EstCommenceDate", Description = "OpportunityGridViewModel_EstCommenceDate")]
    [UIHint("GridDateColumn")]
    public DateTime? EstCommenceDate { get; set; }

    In GridDateColumn.cshtml I have
    @Html.Kendo().DatePickerFor(m => m).Format("yyyy-MM-dd")

    When I edit a date and try and save changes why does it give this attached error?  Why is the date in US format?

  2. Vladimir Iliev
    Admin
    Vladimir Iliev avatar
    2192 posts

    Posted 17 Jan 2014 Link to this post

    Hi Richard,

    From the provided information it seems that the culture on the client side and the server are different which is invalid configuration. I would suggest to follow the help topic below and update the project to have the same culture on both sides: 


    Regards,
    Vladimir Iliev
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top