Hello I am tryint to bind create action from Kendo Grid:
This is supposed to send Create action to my Admin controller (this works)
Now if I try to create ne record it will trigger my breakpoint in controller but the list (although it has Count=1 for one new record) has GlobalProperty object but with all values (Id,Name,Value) null.
My firebug shows that I have
models[0][id] 0
models[0][name] test
models[0][value] testssss
as a part of my parametres, how do I serialize that to my List?
Please help I was trying to find it but without success.
This thread is copy of http://www.kendoui.com/forums/ui/grid/binding-create-action-null-model.aspx
@(Html.Kendo().Grid<
CPSkla.Models.GlobalProperties
>().Name("GlobalProperties")
.Columns(columns =>
{
columns.Bound(p => p.Id).Hidden();
columns.Bound(p => p.Name);
columns.Bound(p => p.Value);
columns.Command(command => command.Destroy());
})
.DataSource(dataSource => dataSource.Ajax().Batch(true)
.Model(model => model.Id(p => p.Id))
.Create("GlobalProperty_Create", "Admin")
.Read("GlobalProperty_Read", "Admin")
.Update("GlobalProperty_Editing_Update", "Admin")
.Destroy("GlobalProperty_Editing_Destroy", "Admin")
)
.ToolBar(toolbar =>
{
toolbar.Create();
toolbar.Save();
})
.Editable(editable => editable.Mode(GridEditMode.InCell))
)
This is supposed to send Create action to my Admin controller (this works)
public ActionResult GlobalProperty_Create(List<
GlobalProperties
> models)
{
using (var db = new CPSkla.Models.CPSklaEntitiesCalculation())
{
foreach (GlobalProperties model in models)
{
db.GlobalProperties.Add(model);
db.SaveChanges();
}
}
return View(GetViewResult());
}
Now if I try to create ne record it will trigger my breakpoint in controller but the list (although it has Count=1 for one new record) has GlobalProperty object but with all values (Id,Name,Value) null.
My firebug shows that I have
models[0][id] 0
models[0][name] test
models[0][value] testssss
as a part of my parametres, how do I serialize that to my List?
Please help I was trying to find it but without success.
This thread is copy of http://www.kendoui.com/forums/ui/grid/binding-create-action-null-model.aspx