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

Use Grid for editing entity children items

Thread ID:





121823 Jan 28,2016 02:16 PM UTC Feb 1,2016 05:58 AM UTC ASP.NET MVC 3
Tags: Grid
Asked On January 28, 2016 02:16 PM UTC

Hi Syncfusion,

Thanks for your hard work. You are realy make the web world better:). I am a beginer in Web Development, but I can understand how to use your library without any problem.

When I implement editing of children items for intity, I want to use your Grid. 
I have a question for you. I have two entity with N<->N relationship. To edit one of them I use your grid with Datasource with type AdaptorType.RemoteSaveAdaptor. 
This datasource should get three URL for item changing at the server(UpdateURL, RemoveURL and InsertURL). In this case the standeard behaviour of these operations is not good cause for me. I need pass additional params, such as ID of parent edited entity. Are there any workaround to implement this.

Example code:

First class:

public partial class Community
    public Community()
        this.ContactCollection = new HashSet<Contact>();
        this.AddressCollection = new HashSet<Address>();
        this.AdditionInfoCollection = new HashSet<AdditionInfo>();
    public long Id { get; set; }
    public virtual ICollection<Contact> ContactCollection { get; set; }
    public virtual ICollection<AdditionInfo> AdditionInfoCollection { get; set;      }

Second class:

public partial class Address
    public Address()
        this.CommunityCollection = new HashSet<Community>();
        this.AdditionInfoCollection = new HashSet<AdditionInfo>();
    public int AddressId { get; set; }
    public string Street { get; set; }
    public string City { get; set; }
    public string Country { get; set; }
    public string HomeData { get; set; }
    public string GpsX { get; set; }
    public string GpsY { get; set; }
    public virtual ICollection<Community> CommunityCollection { get; set; }
    public virtual ICollection<AdditionInfo> AdditionInfoCollection { get; set; }

I create Edti razr-page for class Comunity and use Grid

 .Datasource(ds => ds.Json(Model.AdressesCollection.AsEnumerable<object>())
 .FilterSettings(filter => { filter.ShowFilterBarStatus().StatusBarWidth(500).FilterBarMode(FilterBarMode.Immediate); })   /*Filtering Enabled*/
 .AllowSorting()    /*Sorting Enabled*/
 .AllowPaging()    /*Paging Enabled*/
     .ClientSideEvents(eve => { eve.ActionBegin("AddressesGridBeginAction");  })
 .EditSettings(edit => edit.AllowAdding().AllowDeleting().AllowEditing())
     .ToolbarSettings(toolbar =>
         toolbar.ShowToolbar().ToolbarItems(items =>
 .Columns(col =>

at the controller should be: AddressesListUpdate(Address updateItem, int communityId)
where communityId is an address holder. 

Thank you very much!

Best regards,

Gowthami V [Syncfusion]
Replied On January 29, 2016 07:15 AM UTC

Hi Egor,

Thanks for using Syncfusion products.

You can pass the additional key values using the Headers of the ejDataManager. While performing update (save) action in the actionBegin event, add the required number of array of objects into Headers and retrieve them using the Request object of the HttpRequestMessage. 

Refer to the below code example,


                 .Datasource(ds => ds.Json((System.Collections.IEnumerable)ViewBag.DataSource).UpdateURL("/Home/Update").InsertURL("/Home/Insert").RemoveURL("/Home/Delete").Adaptor(AdaptorType.RemoteSaveAdaptor))
. . . .
. . . .

.ClientSideEvents(events => { events.ActionComplete("complete").ActionBegin("begin"); })


<script type="text/javascript">

var id = @Model.Id; //Getting ID from Model, considering Model as Community object.

    function begin(args) {

        if (args.requestType == 'save') {

            args.model.dataSource.dataSource.headers = [];

           args.model.dataSource.dataSource.headers.push({ "communityId": id });  //adding additional parameter to datamanager header



    function complete(args) {

        if (args.requestType == 'save') args.model.dataSource.dataSource.headers = [];//to avoid headers value to be interfered with other actions, emptied the Headers



public ActionResult Update(List<EditableOrder> value)


           int obj = Int32.Parse(Request.Headers.GetValues("communityId")[0]); //additional parameter communitId

. . . .

. . . .

            return Json(data, JsonRequestBehavior.AllowGet);


From your code example, we found that you are using Community object in Model. So, we are directly getting the community ID from Model.

We have already discussed about sending custom headers to the server in the following KB,



Gowthami V.

Replied On January 29, 2016 10:33 AM UTC

Hi Gowthami,
I try your suggestion and IT WORKS!!! Thank you very much!
You are the best!

Seeni Sakthi Kumar Seeni Raj [Syncfusion]
Replied On February 1, 2016 05:58 AM UTC

Hi Egor,

We are happy to hear that the solution meets your requirement. Please let us know if you need any further assistance.

Seeni Sakthi Kumar S.


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