If I bulid the grid with Model, it is working. But If I Pass the same model to the partial, it is not working. It is throwing an error message saying.The model item passed into the dictionary is of type 'Models.Asset', but this dictionary requires a model item of type 'System.Collections.Generic.List`1Below is my Kendo grid and here is my Partial
@Html.Partial("_Address", Model.Address)
@(Html.Kendo().Grid(Model.Address)
.Name("Grid")
.Columns(columns =>
{
columns.Bound(p => p.Id).Hidden();
columns.Bound(p => p.Address).Width(300);
columns.Command(command => { command.Edit(); command.Destroy(); }).Width(200);
})
.Events(events =>
{
events.Save("onSave");
events.Edit("onEdit");
})
.Editable(editable => editable.Mode(GridEditMode.InLine))
.ToolBar(toolBar =>
{
toolBar.Create().Text("Add Address");
})
.Scrollable()
.DataSource(dataSource => dataSource
.Ajax()
.Events(events => events.Error("onError"))
.Model(model => model.Id(p => p.Address))
.ServerOperation(false)
)
)
@Html.Partial("_Address", Model.Address)
@(Html.Kendo().Grid(Model.Address)
.Name("Grid")
.Columns(columns =>
{
columns.Bound(p => p.Id).Hidden();
columns.Bound(p => p.Address).Width(300);
columns.Command(command => { command.Edit(); command.Destroy(); }).Width(200);
})
.Events(events =>
{
events.Save("onSave");
events.Edit("onEdit");
})
.Editable(editable => editable.Mode(GridEditMode.InLine))
.ToolBar(toolBar =>
{
toolBar.Create().Text("Add Address");
})
.Scrollable()
.DataSource(dataSource => dataSource
.Ajax()
.Events(events => events.Error("onError"))
.Model(model => model.Id(p => p.Address))
.ServerOperation(false)
)
)