Hi people, first of all sorry for my english.
My doubt is how i can inform to the user if a row of the grid was succesfully deleted from the database or if occured some error
My code is something like this
.cshtml
$('#grdFeeds').live('iggridupdatingrowdeleting', function (e, args) { return confirm("Sure to delete the row?"); });
$('#grdFeeds').live('iggridupdatingrowdeleted', function (e, args) { $("#grdFeeds").igGrid("saveChanges"); $("#grdFeeds").igGrid("dataBind"); } );
Controller.cs
public ActionResult EditingSaveChanges() { try { GridModel Model = new GridModel(); List<Transaction<Feed>> transactions = Model.LoadTransactions<Feed>(HttpContext.Request.Form["ig_transactions"]); FeedNotificationEF oEF = new FeedNotificationEF(); foreach (Transaction<Feed> oTran in transactions) { switch (oTran.type) { case "deleterow": int id = int.Parse(oTran.rowId); Feed deleteFeed = oEF.Feeds.FirstOrDefault(FEE => FEE.ID == id); if (deleteFeed != null) { oEF.Feeds.DeleteObject(deleteFeed); oEF.SaveChanges(); } break; default: break; } } return View(); }
catch (Exception ex) { }
Regards.
Pablo
hi,
You can refer to the following thread:
https://es.infragistics.com/community/forums/f/ignite-ui-for-javascript/63657/understanding-commit-updateurl-transactionlog-savechanges/322437#322437
Hope it helps. Thanks,
Angel