We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Error Deleting row in Grid Control

Thread ID:





124268 May 27,2016 01:00 PM UTC May 30,2016 08:20 AM UTC ASP.NET MVC 1
Tags: Grid
André Secco
Asked On May 27, 2016 01:00 PM UTC

I'm have a problem to delete row in Grid Control, but the following error appears:

The parameters dictionary contains a null entry for parameter 'id' of non-nullable type 'System.Int32' for method 'System.Web.Mvc.ActionResult Remove(Int32)' in 'Test.Controllers.HomeController'. An optional parameter must be a reference type, a nullable type, or be declared as an optional parameter.

Nome do parâmetro: parameters

Following the code I use:


                    .Datasource(ds => ds.Json(Model).RemoveURL("Home/Remove").Adaptor(AdaptorType.RemoteSaveAdaptor))
                        .FilterSettings(filter =>
                    .EditSettings(e => e.AllowDeleting())
                    .Columns(col =>
                         col.Commands(command =>
                                    .ButtonOptions(new Syncfusion.JavaScript.Models.ButtonProperties()
                                        Text = "Editar",
                                        ContentType = ContentType.TextAndImage,
                                        Width = "80",
                                        PrefixIcon = "e-edit"
                                    .ButtonOptions(new Syncfusion.JavaScript.Models.ButtonProperties()
                                        Text = "Excluir",
                                        ContentType = ContentType.TextAndImage,
                                        Width = "80",
                                        PrefixIcon = "e-delete"
                         col.Field("DataModificacao").HeaderText("Data de Modificação").Width(40).Format("{0:MM/dd/yyyy}").Add();


        [HttpPost, ActionName("Remove")]
        public ActionResult DeleteConfirmed(int id)
            PISRegra pisRegra = db.Regras.Find(id);
            return RedirectToAction("Index");

Thanks for help!

Jayaprakash Kamaraj [Syncfusion]
Replied On May 30, 2016 08:20 AM UTC

Hi André, 

Thank you for contacting Syncfusion support. 

We need to pass the parameter as “key” while performing delete operation at server side by using RemoveURL property. Please refer to the below code example, sample and Help document.   
  .Datasource(ds => ds.Json((IEnumerable<object>)ViewBag.dataSource).InsertURL("/Grid/PerformInsert") 
public ActionResult PerformDelete(int key) 
            db.OrderTables.Remove(db.OrderTables.Single(o => o.OrderID == key)); 
            var data = db.OrderTables.ToList(); 
            return Json(data, JsonRequestBehavior.AllowGet); 
Jayaprakash K. 


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon