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

Question about Grid DataSource

Thread ID:





118221 Feb 12,2015 11:44 AM UTC Feb 13,2015 10:31 AM UTC ASP.NET MVC 3
Tags: Grid
Andrea Perazzolo
Asked On February 12, 2015 11:44 AM UTC

I have defined a grid like this:

                               .Datasource(ds => ds.Json((IEnumerable<object>)ViewBag.DataSourceTmp).InsertURL("AddResourceAllocation").UpdateURL("EditResourceAllocation").RemoveURL("DeleteResourceAllocation").Adaptor(AdaptorType.RemoteSaveAdaptor))
                 .EditSettings(es => es.AllowEditing(true))
                                                           .ToolbarSettings(ts => ts.ShowToolbar().ToolbarItems(ti =>
 .Columns(col =>
     col.Field("FirstName").HeaderText("First Name").Add();
     col.Field("LastName").HeaderText("Last Name").Add();
 .ClientSideEvents(cse => cse.BeginEdit("onBeginEditResource"))
function onClickResource(args) {
    var curGridElement = this.element.closest("div[id^='child3_grid']");
    var curGrid = $(curGridElement).ejGrid("instance");
    var index = this.element.closest("tr").index();
    var record = curGrid.getCurrentViewData()[index];
    var idProject = $("#Project_IdProject").val();
    var objData = { IdProject: idProject, record: record };
    eDialogAllocated.position = { X: this.element.offset().left - 900, Y: this.element.offset().top };
    var str = JSON.stringify(record);
    var jqxhr = $.post("@Url.Action("GetResourcesAllocatedCountry""Resources")", objData)
        .done(function(data) {
            var obj = $("#ResourceAllocated").ejGrid("instance");
        .fail(function(data) {
        .always(function() {

in which I need to reload the Datasource via Javascript.
After that, when I Edit the Record, the Edit Url is not called.
When I refresh the dataSource is it possible that the adaptor is lost?

  Thanks in advance

   Andrea Perazzolo

Andrea Perazzolo
Replied On February 12, 2015 02:13 PM UTC

I noticed that this problem is in the Patched Service Pack scripts, and is not present in the previous version of the scripts.
When I reverted to the Script you provided me in January 20, the method is called even after the change of DataSource.
This version has another problem which  I asked in another thread, regarding the binding of the DateTime Fields.

    Andrea Perazzolo

Andrea Perazzolo
Replied On February 13, 2015 07:45 AM UTC

I forgot to mention that the Grid is inside a Dialog Control, maybe this is the problem.
Regarding last reply, it was my mistake, the problem there is also with the other patched version of the scripts.

    Hope it helps

    Andrea Perazzolo

Prasanna Kumar Viswanathan [Syncfusion]
Replied On February 13, 2015 10:31 AM UTC

Hi Andrea,

Thanks for using Syncfusion Products.

We have analyzed your sample and found that you have bounded the local data directly with the datasource that affects all URL’s, which is the root cause of the issue. So, we suggest you to use ej.DataManager for binding the data. While binding the data using ej.DataManager, we can include all insert/update and delete URL’s. Then, we have to bind that datamanager with the datasource.

Please find the below code snippet:


        click: function (args) {


                .done(function (data) {

                    var genData = ej.DataManager({ json: data, updateUrl: "NormalUpdate", insertUrl: "NormalInsert", removeUrl: "NormalDelete", adaptor: "remoteSaveAdaptor" })

                    var gridObj = $("#FlatGrid").ejGrid("instance");

                    gridObj.dataSource(genData);// Datasource bind to grid




For your convenience we have created a sample and sample can be downloaded from the below link

Sample Link :  http://www.syncfusion.com/downloads/support/directtrac/118221/Sample1182211678771919.zip

Please let us know if you have any queries,


Prasanna Kumar N.S.V


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