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. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Passing Data to server in the URL Adaptor Inline form

Thread ID:





140962 Nov 15,2018 10:48 PM UTC Nov 19,2018 08:23 AM UTC ASP.NET MVC 3
Tags: Grid
Asked On November 15, 2018 10:49 PM UTC

Hello Guys,

I am using the Syncfusion MVC grid I am facing the problem while passing data to a server in sync fusion when we update the grid. Every time the update method it gives me model properties as null only even when everything seems right.
Below is my code. can anyone know what I am doing wrong or what I am missing?

Below is CSHTML code

                                                   .Datasource(datasource => datasource.URL(@Url.Action("Search")).UpdateURL(@Url.Action("Update"))
                                                    .EditSettings(edit => { edit.AllowAdding().AllowEditing().EditMode(EditMode.InlineForm).ShowConfirmDialog(true).TitleColumn("Code"); })
                                                        .ToolbarSettings(toolbar =>
                                                            toolbar.ShowToolbar().ToolbarItems(items =>
                              .SortSettings(builder => builder.SortedColumns(col => col.Field("Code").Direction(SortOrder.Ascending).Add()))
                                                  .FilterSettings(filter => { filter.FilterType(FilterType.Excel).FilteredColumns(col => col.Field("Available").Operator(FilterOperatorType.Equals).Value("Enabled").Add()); })
                                                  .Columns(col =>
                                                      col.Field(x => x.IsVerify)
                                                      col.Field(x => x.Id)
                                                      col.Field(x => x.Code)
                                                                  + "{{:Code}}"
                                                                  + "
                                                        .ValidationRules(v => v.AddRule("required", true))
                                                      col.Field(x => x.Description)
                                                      col.Field(x => x.Handing)
                                                      col.Field(x => x.Range)
                                                      col.Field(x => x.Rule)
                                                      col.Field(x => x.Available)
                                              .HeaderText(" ")
                                              .Template(" View" +
                                              "Edit" +
                                              "Duplicate" +
                                              "{{if IsActive}}" +
                                              "Disable" +
                                              "{{else}}" +
                                              "Enable" +

And below is my C# code of the controller

        public ActionResult Search(DataManager dataManager)
            var products = _productsService.GetAllProducts().ToList();

            var data = ApplySearch(dataManager, products, out var count);

            return Json(new { result = data, count });

        public ActionResult Update(ProductRowViewModel model)
             HttpContext.Response.StatusCode = (int)System.Net.HttpStatusCode.BadRequest;
            return Json(new { Success = false, Message = "Code must be unique!" }, JsonRequestBehavior.AllowGet);

All the properties in the model are coming null. however the model is perfect
I am using the URL Adapter.

Vignesh Natarajan [Syncfusion]
Replied On November 16, 2018 11:47 AM UTC

Hi Sandip, 
Thanks for contacting Syncfusion support.  
From your query, we understand that you are facing issue while updating the record in server side. While updating the records you have tried to receive the parameters as model (public ActionResult Update(ProductRowViewModel model) in server side instead of Value, so it returns the object as null. In Grid, we have passed the updated parameters in the form of objects and in name of value.  
So we suggest you to follow as like below code example 
                              .Datasource(ds => ds.URL("/Grid/UrlDataSource").UpdateURL("/Grid/Update").InsertURL("/Grid/Insert").RemoveURL("/Grid/Delete") 
  public ActionResult Update(Orders value) 
            Orders val = order.Where(or => or.OrderID =value.OrderID).FirstOrDefault(); 
            val.OrderID = value.OrderID; 
            val.EmployeeID = value.EmployeeID; 
            val.CustomerID = value.CustomerID; 
            val.ShipCity = value.ShipCity; 
            return Json(value); 
Refer to the screenshot for the output 
For your convenience we have prepared a sample which can be downloaded from below link 
Please get back to us if you need any further assistance. 
Vignesh Natarajan 

Replied On November 19, 2018 12:23 AM UTC

Thanks. After applying its working for me.

Vignesh Natarajan [Syncfusion]
Replied On November 19, 2018 08:23 AM UTC

Hi Sandip, 

Thanks for the update. 

We are glad to hear that your query has been resolved by your solution. 

Please get back to us if you have further queries. 

Vignesh Natarajan  


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

This page will automatically be redirected to the 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

Live Chat Icon For mobile
Live Chat Icon