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

[Solved] When editing and cancelling a date edit, the grid displays a raw Date object

0 Answers 5 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Rob
Top achievements
Rank 1
Rob asked on 22 Oct 2012, 05:58 PM
I have a grid that looks something like this:

@(Html.Telerik().Grid (Model.Brand.ClosedTimes)
    .Name(ViewData.TemplateInfo.GetFullHtmlFieldName("ClosedTimes"))
    .Footer(false)
    .ToolBar(commands => commands.Insert().ButtonType(GridButtonType.BareImage))
    .DataKeys(keys => keys.Add(c => c.Id))
    .DataBinding(dataBinding => dataBinding
                       .Ajax()
                        .Insert("InsertClosedTime", "BrandOperations")
                        .Update("SaveClosedTime", "BrandOperations")
                        .Delete("DeleteClosedTime", "BrandOperations")
                         .Select("SelectClosedTimes", "BrandOperations")
                    )
    .Editable(editing => editing.Mode(GridEditMode.InLine))
                  
    .Columns(columns =>
                 {
                     columns.Command(commands =>
                     {
                         commands.Edit().ButtonType(GridButtonType.BareImage);
                     });
                     columns.Bound(x => x.EffectiveFrom).Title("Effective From").ClientTemplate("<#= $.telerik.formatString('{0:dd/MM/yyyy}', EffectiveFrom) #>").Format("{0:dd/MM/yyyy}");
                     columns.Bound(x => x.EffectiveTo).Title("Effective To").ClientTemplate("<#= $.telerik.formatString('{0:dd/MM/yyyy}', EffectiveTo) #>").Format("{0:dd/MM/yyyy}");
                     columns.Bound(x => x.DayOfWeek).Title("Day of week");
                     columns.Bound(x => x.StartTime).Title("Start Time");
                     columns.Bound(x => x.EndTime).Title("End Time");
                     columns.Command(commands =>
                     {
                         commands.Delete().ButtonType(GridButtonType.BareImage);
                     });
                 }
            ))

In the UI, I click the edit icon, then click the cancel icon and the date value is replaced by a value that looks like this:

/Date(1302691865433)/

Any ideas what needs to be done?
Tags
General Discussions
Asked by
Rob
Top achievements
Rank 1
Share this question
or