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

Grid not updated after New Recorded is added

Thread ID:





128652 Feb 2,2017 09:17 PM UTC Feb 9,2017 04:01 PM UTC ASP.NET MVC 3
Tags: Grid
Michael Lambert
Asked On February 2, 2017 09:17 PM UTC

I'm using inline editing in the Grid.  When I insert a new record and after saving it, it disappears from the Grid.  I created a button with:
            var gridObj = $("#OneCloudGrid").ejGrid("instance");
It reappears after I press it!
Seems like the grid needs to be refreshed after an Insert to display the newly added record.  My question is, where would I place these lines of code so that I don't have to press the button after every add.  I would think actionComplete("add"), put that seems to fires right after the add new button is pressed, before the record is even saved.


Prasanna Kumar Viswanathan [Syncfusion]
Replied On February 3, 2017 12:52 PM UTC

Hi Michael, 

Thanks for contacting Syncfusion support. 

Before we proceed with your query, please confirm the following details 

1. You have mentioned when insert a new record and after saving it, it disappears from the Grid. So, are you using any adaptors like URL, remoteSave etc.? 
2. Code example of a Grid and controller. 
3. While using adaptors and if you face any exception on grid save action, Share the screenshot of an exception.   
4.  Have you enable isIdentity property for the primary key column? 
5. If possible, share the video demonstration of an issue. 
6. Essential Studio Version details.  

Prasanna Kumar N.S.V 

Michael Lambert
Replied On February 8, 2017 06:08 PM UTC

Here is the controller data: (Full code attached)
        public ActionResult GetData(Syncfusion.JavaScript.DataManager dm)
            System.Collections.IEnumerable Data = db.Requests.ToList();
            sgDataResult result = new sgDataResult();
            Syncfusion.JavaScript.DataSources.DataOperations operation = new Syncfusion.JavaScript.DataSources.DataOperations();
            if (dm.Sorted != null && dm.Sorted.Count > 0) //Sorting
                Data = operation.PerformSorting(Data, dm.Sorted);
            if (dm.Where != null && dm.Where.Count > 0) //Filtering
                Data = operation.PerformWhereFilter(Data, dm.Where, dm.Where[0].Operator);
            if (dm.Search != null && dm.Search.Count > 0) //searching
                Data = operation.PerformSearching(Data, dm.Search);

            List<string> str = new List<string>();
            if (dm.Aggregates != null)
                for (var i = 0; i < dm.Aggregates.Count; i++)
                result.aggregate = operation.PerformSelect(Data, str);

            int count = Data.AsQueryable().Count();

            if (dm.Skip != 0)
                Data = operation.PerformSkip(Data, dm.Skip);
            if (dm.Take != 0)
                Data = operation.PerformTake(Data, dm.Take);
            result.count = count;
            result.result = Data;
            return Json(result, JsonRequestBehavior.AllowGet);

        public ActionResult Insert(Request value)
            value.Created = DateTime.Now;
            value.CreatedBy = ((AuthUser)Session["user"]).Name;
            value.ISChoice = "OneCloud";
            db.Requests.Add(value);   value of value.RequestID (which is the PK) = 0 - which is correct at this time
after SaveChanges the value of value.RequestID(PK) should be updated to the new PK value but it's still 0
            catch (Exception ex)
                return new HttpStatusCodeResult(HttpStatusCode.BadRequest, "Database Error: " + ex.Data);
            return Json(value, JsonRequestBehavior.AllowGet);

View Data
                                .Datasource(ds => ds.URL(@Url.Action("GetData", "AdminOC")).UpdateURL(@Url.Action("Update", "AdminOC")).InsertURL(@Url.Action("Insert", "AdminOC")).Adaptor(AdaptorType.UrlAdaptor))
                                .EditSettings(edit => { edit.AllowEditing().AllowAdding(); })

            .Columns(col =>
                col.Field(p => p.RequestID).HeaderText("Request ID").AllowEditing(false).IsIdentity(true).IsPrimaryKey(true).TextAlign(TextAlign.Center).Width(93).Add();
                col.Field(p => p.Period).HeaderText("Period").Width(82).TextAlign(TextAlign.Center).EditType(EditingType.Dropdown).DataSource(Model.ddlists.nsPeriod).Add();

Attachment: Code_720aa7c4.zip

Thavasianand Sankaranarayanan [Syncfusion]
Replied On February 9, 2017 04:01 PM UTC

Hi Michael, 

We have analyzed your query and we are unable to reproduce the reported issue in our end. If isIdentity is enabled in grid column, the newly added record will be added in the grid. 

We have attached a video link of sample execution and it will be downloadable in the below location. 
Please provide the following details, for better assistance. 
1.       Video demonstration of issue. 
2.       Clear replication  procedure of issue. 
3.       Essential studio version. 
4.       If possible, replicate the issue in the attached sample. 
We have prepared a sample for your convenience and it can be downloadable in the below location. 

Thavasianand 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

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