Search code examples
asp.net-mvc-4kendo-uikendo-gridkendo-asp.net-mvckendo-datetimepicker

Kendo Grid inline edit with Datetime DatePickerFor


kendo inline cell edit not support for datetime format. I need "dd/MMM/yyyy" data format but kendo grid shows "the filed date must be a date" error. can you please advice me to what to do


Solution

  • You can use a custom editor to do this.

    References:

    The code would look something like this (not tested, but it should be close enough to give you the right idea):

    var customDateEditor = function (container, options) {
        $('<input />')
            .appendTo(container)
            .kendoDatePicker({
                format: "dd/MMM/yyyy"
            });
    };
    
    $("#grid").kendoGrid({
        ...
        columns:[
            {
                field: "myDate",
                format: "dd/MMM/yyyy",
                editor: customDateEditor
            }
        ]
    });