This is a migrated thread and some comments may be shown as answers.

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

1 Answer 77 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Richard
Top achievements
Rank 1
Richard asked on 16 Jan 2014, 03:58 AM
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?

1 Answer, 1 is accepted

Sort by
0
Vladimir Iliev
Telerik team
answered on 17 Jan 2014, 09:41 AM
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!
Tags
Grid
Asked by
Richard
Top achievements
Rank 1
Answers by
Vladimir Iliev
Telerik team
Share this question
or