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

Kendo UI MVC Grid Date In-Line Edit Validation Error - Value is not Valid

1 Answer 636 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Vikas
Top achievements
Rank 1
Vikas asked on 25 Jul 2013, 06:26 AM
I have been stuck with this problem without much luck. I've gone down multiple paths and done google search but can’t seem to find a solution that works. Any help would be greatly appreciated.
I am using Kendo MVC grid wired up for CRUD.

@model IEnumerable<CustomerModels>
@(Html.Kendo().Grid(Model)
.Name("grid")
.Columns(columns =>
    {
        columns.Bound(Customer => Customer.Name);
        columns.Bound(Customer => Customer.Number);
        columns.Bound(Customer => Customer.Phone);
        columns.Bound(Customer => Customer.DOB).Format("{0:d}").EditorTemplateName("Date");
        columns.Command(command => { command.Edit(); });
    })
                .DataSource(dataSource => dataSource
                            .Ajax()
                            .PageSize(20)         
                            .Read(read => read.Action("FilterMenuCustomization_Read", "Home"))
                                    .Model(model => { model.Id(c => c.Phone); model.Field(c=>c.DOB);})
                                           .Update(update => update.Action("FilterMenuCustomization_Update", "Home"))
                                   )
                                   
        .Pageable()
        .Sortable()
           )

When i try to edit the date field using Date Picker or even without any change to existing date, If i try to submit It gives me Error message as "DOB is not valid date".
Ex. 25/07/2013
I have included Culture and EditorTemplates as mentioned in some of the solutions i found on internet, But no help.
Any idea as to what i am doing wrong?
  

1 Answer, 1 is accepted

Sort by
0
Accepted
Petur Subev
Telerik team
answered on 26 Jul 2013, 02:33 PM
Hello Vikas,

If you have added the the kendo.culture file which has the same format as the format of the DateTime picker and you have registered the culture then there should not be any validation error of that kind.

Follow the instructions here:

http://docs.kendoui.com/getting-started/framework/globalization/overview

and here:

http://docs.kendoui.com/getting-started/using-kendo-with/aspnet-mvc/globalization

If you still struggle with the case, assemble a demo project which we can run to see what else might cause this.

Kind Regards,
Petur Subev
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
Vikas
Top achievements
Rank 1
Answers by
Petur Subev
Telerik team
Share this question
or