When the grid goes into edit mode DateTime picker clears the value

I have a DateTime field bound to a grid. When the grid goes into edit mode, displays the date / time, but the value is cleared from it. This forces the user to re-enter the date / time. Any idea why this value is cleared when starting edit mode?

@(Html.Telerik().Grid<ExpenseGridModel>()
    .DataBinding(dataBinding => dataBinding.Ajax()
        .Select("ExpenseAjaxBinding", "ExpenseEntry")
        .Update("ExpenseUpdate", "ExpenseEntry")
    )
    .Name("ExpensesGrid")
    .DataKeys(keys => keys.Add(r => r.id))
    .Columns(columns =>
        {
            columns.ForeignKey(o => o.categoryId, Model.expenseCategories, "Id", "Name");
            columns.ForeignKey(o => o.typeId, Model.expenseTypes, "Id", "Name");
            columns.Bound(r => r.date);
            columns.ForeignKey(o => o.classId, Model.expenseClasses, "Id", "Name");
            columns.Bound(r => r.description);
            columns.Bound(r => r.amount);
            columns.Command(commands =>
                    commands.Edit()                                          
            );
        })
         )
+3
source share
1 answer

I fixed the problem by installing an editor template. The default is DateTime Picker. Fortunately, I do not need a part of TimePicker.

columns.Bound(r => r.date).Format("{0:d}").EditorTemplateName("Date");
+1
source

All Articles