Hello,
actually im facing a really bad problem with the kendo grid. I built a grid with batch editing, like shown in the kendo docs. The date is shown well in the normal display mode in the format i set {0:y} which displays month and year.
To edit this field, i use the Kendo Date Picker (this doest matter at all). So when the grid switches to edit mode, the date is not formatted and instead shown in the format "Mon Oct 01 2012 00:00:00 GMT+0200". I cant submit it in this format, because my validator gives me an error.
As i already spent hours on searching on that topic, i found a few things which acutally dont work for me. I set up the localized js files properly:
As i can see in the display mode, the date is well formatted to the spanish format, which is my culture. So this works.
Maybe another info is, how my Data Class looks like (i tried as well with datatype datetime):
So im kind of lost, what the problem is. I also tried the ClientTemplate Property, but this is only called when the grid is in display mode.
King regards
actually im facing a really bad problem with the kendo grid. I built a grid with batch editing, like shown in the kendo docs. The date is shown well in the normal display mode in the format i set {0:y} which displays month and year.
To edit this field, i use the Kendo Date Picker (this doest matter at all). So when the grid switches to edit mode, the date is not formatted and instead shown in the format "Mon Oct 01 2012 00:00:00 GMT+0200". I cant submit it in this format, because my validator gives me an error.
As i already spent hours on searching on that topic, i found a few things which acutally dont work for me. I set up the localized js files properly:
@{
var culture = System.Threading.Thread.CurrentThread.CurrentCulture.ToString();
}
<
script
src
=
"@Url.Content("
~/Scripts/cultures/kendo.culture." + culture + ".min.js")")</
script
>
<
script
>
kendo.culture("@culture");
</
script
>
As i can see in the display mode, the date is well formatted to the spanish format, which is my culture. So this works.
Maybe another info is, how my Data Class looks like (i tried as well with datatype datetime):
[DataType(DataType.Date)]
[DisplayFormat(ApplyFormatInEditMode=
true
, DataFormatString=
"{0:y}"
)]
public
DateTime Date {
get
;
set
; }
So im kind of lost, what the problem is. I also tried the ClientTemplate Property, but this is only called when the grid is in display mode.
King regards