When using grid control for ASP.NET MVC 5 application and adjusting it as in demo provided, controls are duplicated for InlineForm or Dialog EditMode. Actually controls aren't duplicated but there are as many control sets there as records available. It seems as actual selection of record prior to editing has no effect whatsoever.
Here is relevant server side code:
public ActionResult Edit()
{
ViewBag.dataSource = db.Parties.ToArray();
return View();
}
public ActionResult InlineUpdate(Party value)
{
Party result = db.Parties.Where(o => o.Id == value.Id).FirstOrDefault();
db.Entry(result).CurrentValues.SetValues(value);
db.SaveChanges();
return Json(db.Parties.ToArray(), JsonRequestBehavior.AllowGet);
}
public ActionResult InlineInsert(Party value)
{
db.Parties.Add(value);
db.SaveChanges();
return Json(db.Parties.ToArray(), JsonRequestBehavior.AllowGet);
}
public ActionResult InlineDelete(int key)
{
Party result = db.Parties.Where(o => o.Id == value.Id).FirstOrDefault();
db.Parties.Remove(result);
db.SaveChanges();
return Json(db.Parties.ToArray(), JsonRequestBehavior.AllowGet);
}
On a client side view is as follows:
@using Syncfusion.JavaScript.Models
@{
ViewBag.Title = "Parties";
}
<h2>Parties</h2>
<div id="ControlRegion">
@(Html.EJ().Grid<object>("Editing")
.Datasource(ds => ds.Json((IEnumerable<object>)ViewBag.dataSource).UpdateURL("InlineUpdate").InsertURL("InlineInsert").RemoveURL("InlineDelete").Adaptor(AdaptorType.RemoteSaveAdaptor))
.EnableAltRow()
.EditSettings(edit => { edit.AllowAdding().AllowDeleting().AllowEditing().EditMode(EditMode.InlineForm); })
.AllowPaging()
.ToolbarSettings(toolbar =>
{
toolbar.ShowToolbar().ToolbarItems(items =>
{
items.AddTool(ToolBarItems.Add);
items.AddTool(ToolBarItems.Edit);
items.AddTool(ToolBarItems.Delete);
items.AddTool(ToolBarItems.Update);
items.AddTool(ToolBarItems.Cancel);
});
})
.Columns(col =>
{
col.Field("Name").HeaderText("Name").Width(90).Add();
col.Field("Surname").HeaderText("Surname").Width(90).Add();
})
)
</div>
Finally, result with either inline form or dialog is that there is sets as many as records there:
As the message implies, it seems that record selection isn't properly reflected in javascript code. Version used is 15.1.0.33 and Sample Creator is used to devise solution.
Browser is Chrome 58.
Here is finally excerpt from final page source heading (if review of actual content/js is of some help):
<link rel='nofollow' href="/Content/bootstrap.css" rel="stylesheet"/>
<link rel='nofollow' href="/Content/site.css" rel="stylesheet"/>
<link rel='nofollow' href="/Content/ej/web/Flat-Lime/ej.web.all.min.css" rel="stylesheet"/>
<script src="/Scripts/modernizr-2.6.2.js"></script>
<script src="/Scripts/jquery-3.1.1.min.js"></script>
<script src="/Scripts/jsrender.min.js"></script>
<script src="/Scripts/ej/ej.web.all.min.js"></script