I'm having issues using MVC6, Entity Framework 7, and the latest SyncFusion files. When I insert a new row, I hit the breakpoint in my insert method in the controller. In the web, the new row data is getting passed as JSON, but when it hits my insert method, the parameter is empty instead of containing the new row info JSON. Any ideas?
View:
@{Html.EJ().Grid<ToDo>("ToDoItemGrid")
.AllowPaging()
.EditSettings(edit => { edit.AllowAdding().AllowDeleting().AllowEditing().EditMode(EditMode.Dialog).ShowDeleteConfirmDialog(); })
.ShowColumnChooser()
.EnableAltRow()
.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);
items.AddTool(ToolBarItems.Search);
items.AddTool(ToolBarItems.PrintGrid);
});
})
.Columns(col =>
{
col.Field("ToDoItem").HeaderText("To Do").TextAlign(TextAlign.Left).Width(100).Add();
col.Field("DueDate").HeaderText("Due Date").Format("{0:MM/dd/yyyy}").TextAlign(TextAlign.Left).Width(25).EditType(EditingType.Datepicker).Add();
col.Field("IsImportant").HeaderText("Important").TextAlign(TextAlign.Left).Width(25).EditType(EditingType.Boolean).Add();
})
.Datasource(ds => ds.Json(ViewBag.Model).InsertURL(@insertUrl).RemoveURL(@removeUrl).Adaptor(AdaptorType.RemoteSaveAdaptor))
.Render();
}
Controller:
public ActionResult Insert(ToDo value)
{
if (ModelState.IsValid)
{
_repository.AddTodo(value);
}
var toDoItems = _repository.GetAllItems();
return Json(toDoItems);
}
Thanks!
Cody
Attachment:
NewRowDataImages_e8388a16.zip