Can you show us your front end? (If you need clarification)
You probably need to tell what the model is so that when the edit goes to the ActionResult it know the correct record to modify. So in my example below look at the dataSource.model part.
Then on your Edit method in your original post some something like this...
Sub subToUpdate = db.Subs.FirstOrDefault(s=>s.ID);
For example....
@(Html.Kendo().Grid<
DepartmentViewModel
>()
.Name("Dept_Grid")
.Columns(columns =>
{
columns.Bound(p => p.Name).Title("Department");
columns.Bound(p => p.AdGuid).Title("AD Identifier");
columns.Bound(p => p.ManagerId).Title("Manager");
columns.Bound(p => p.DeptEmail).Title("Dept Email");
columns.Bound(p => p.IsPublic).Title("Public");
columns.Command(command => { command.Edit(); command.Destroy(); }).Width(190);
})
.Editable(editable => editable.Mode(GridEditMode.InLine))
.Sortable()
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(20)
.Events(events => events.Error("error_handler"))
.Model(model => model.Id(p => p.Id))
.Read(read => read.Action("DepartmentInline_Read", "Settings"))
.Update(update => update.Action("DepartmentInline_Update", "Settings"))
.Destroy(update => update.Action("DepartmentInline_Destroy", "Settings"))
)
)
<
script
type
=
"text/javascript"
>
function error_handler(e) {
if (e.errors) {
var message = "Errors:\n";
$.each(e.errors, function (key, value) {
if ('errors' in value) {
$.each(value.errors, function () {
message += this + "\n";
});
}
});
alert(message);
}
}
</
script
>