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

How to update grid data when using Urladaptor

Thread ID:





141136 Nov 26,2018 11:46 AM UTC Nov 27,2018 12:50 PM UTC ASP.NET Core - EJ 2 3
Tags: DataGrid
Asked On November 26, 2018 12:03 PM UTC

Hi! I add record to database using Ajax. How do I refresh the grid (used Urladaptor) after that?

In EJ1 I used grid.refreshContent:
                            url: "Admin/Role_Add",
                            type: "POST",
                            beforeSend: function (xhr) {
                                xhr.setRequestHeader("XSRF-TOKEN", $('input:hidden[name="__RequestVerificationToken"]').val());
                            data: { roleName: inputText }
                        }).done(function (data) {

In EJ2, refreshContent seems not working


Mohammed Farook J [Syncfusion]
Replied On November 26, 2018 12:15 PM UTC

Hi Costa, 
Thanks for contacting Syncfusion support. 
By default the Grid ‘addRecord’ method is automatically refresh the automatically.  Please find code example and the documentation for your reference. 
var gridObj = document.getElementById('Grid')['ej2_instances'][0]; 
gridObj.editModule.addRecord({ OrderID: 10247, CustomerID: 'VINET' }); 
Note : You must enable ‘allowAdding’ as true in Grid editSettings when using addRecord method. Please find the code example. 
<ejs-grid id="Grid"    toolbar="@(new List<string>() { "Add", "Edit", "Delete", "Update", "Cancel" })" allowPaging="true"> 
            <e-grid-editSettings allowAdding="true" allowDeleting="true" allowEditing="true"></e-grid-editSettings> 
. . . 
This is not meet your requirement could you please explain more details about your requirement. 
J Mohammed Farook 

Replied On November 27, 2018 11:06 AM UTC

All right, thanks for correcting me)
However, if someone needs to refresh the data anyway, the method 'grid.refresh()' works to refresh the data in the grid.

Mohammed Farook J [Syncfusion]
Replied On November 27, 2018 12:50 PM UTC

Hi Costa,  
Thanks for your update. 
We are happy to hear that the provided solution has been resolved your problem.  The “refresh()” method of Grid will refresh the Grid header and content. 
Please get back to us if you need further assistance. 
J Mohammed Farook 


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