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

When attempting to change edit mode for a telerik grid to anything other than 'InLine' I get an error about passing in the wrong model type

0 Answers 29 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Ahmed
Top achievements
Rank 1
Ahmed asked on 04 Jan 2012, 04:36 AM

I create the grid like so:

Html.Telerik().Grid<myapp.Date>("dates")
   
.Name("MyGrid")
   
.Pageable(paging => paging.PageSize(10))
   
.Sortable()
   
.Filterable()
   
.Groupable()
   
.DataKeys(keys => keys.Add(c => c.id))
   
.DataBinding(dataBinding =>
   
{
        dataBinding
.Ajax()
       
.Select("_SelectAjaxEditing", "Dates")
       
.Insert("_InsertAjaxEditing", "Dates")
       
.Update("_SaveAjaxEditing", "Dates")
       
.Delete("_DeleteAjaxEditing", "Dates");
   
})
   
.ToolBar(commands => commands.Insert())
   
.Columns(columns =>
   
{
        columns
.Bound(o => o.name);
        columns
.Bound(o => o.date1);
        columns
.Command(commands =>
       
{
            commands
.Edit().ButtonType(GridButtonType.Text);
            commands
.Delete().ButtonType(GridButtonType.Text);
       
});
   
})
   
.Editable(editing => editing.Mode(GridEditMode.InLine))
   
.Render();
   
%>

and it runs fine, but if I change the GridEditMode to be anything other than InLine I get the following error:

The model item passed into the dictionary is of type 'myapp.Date', but this dictionary requires a model item of type 'System.Nullable`1[System.DateTime]'.

There is a system.DateTime field in the grid, is that the reason for this error?

Tags
Grid
Asked by
Ahmed
Top achievements
Rank 1
Share this question
or