- Home
- Forum
- ASP.NET Core - EJ 2
- Empty Row after Insert with RemoteSaveAdaptor and Razor Page
Empty Row after Insert with RemoteSaveAdaptor and Razor Page
Using razor
pages ASP.NET.Core.3.0 and SyncFusion Grid 17.3.0.34
Defining the Grid as following in a “Edit” razor page (using remotesaveadaptor)
Where of source is a Inumerable as follows:
And defining the
insert handler at the same razor page as:
Noting as well that
the CRUDModel class was defined as
The following behavior is produced , when inserting a new record:
- ·
The
database record is correctly inserted on the database;
- ·
The
newly added row is displayed empty on the page
- ·
Looking
at the page source the new record is correctly presented (consistent Json
structure) in the ejs.data.DataManager javascript section
Note that the update handler works as intended,
I'm particularly wondering what would be the correct return of the insert handler.
Any hints
on what could be the issue?
Thanks in advance
SIGN IN To post a reply.
6 Replies
RM
Rui Mendes
December 12, 2019 08:50 AM UTC
Found the solution in this post https://www.syncfusion.com/forums/149288/perform-crud-operation-using-anti-forgery-token-empty-row-after-insert-in-ui
Using ASP.NET.CORE.3.0 the following should be add to ConfigureServices:
services.AddControllers()
.AddNewtonsoftJson(options =>
{
options.SerializerSettings.ContractResolver = new Newtonsoft.Json.Serialization.DefaultContractResolver();
});
TS
Thavasianand Sankaranarayanan
Syncfusion Team
December 12, 2019 11:42 AM UTC
Hi Rui,
Greetings from Syncfusion support.
We checked your reported query with provided sample code but unfortunately were unable to reproduce it from our end. On performing the insert operation the data was properly returned from the controller and displayed in the grid. Please check below sample for reference,
It would be helpful to identify your issue if you could share the following information,
- Network tab screenshot of the response sent from controller to the client.
- Try binding the actionFailure event to the grid and see if it getting hit. If so please share us the error thrown in this event.
- Share console errors thrown on performing the insert operation(if any).
- If possible share us a simple sample application to replicate the issue or try reproducing it in the above provided sample so that we can check and provide proper solution.
Regards,
Thavasianand S.
RM
Rui Mendes
December 18, 2019 05:52 PM UTC
Thanks for the feedback - as mentioned above, solution was found.
TS
Thavasianand Sankaranarayanan
Syncfusion Team
December 19, 2019 06:12 AM UTC
Hi Rui,
Thanks for your update.
We are happy that the problem has been resolved at your end.
Regards,
Thavasianand S.
AV
Avinash
June 20, 2020 07:07 AM UTC
Thanks, I was about to replace syncfusion grid with jquery datagrid. Found this just in time after hours of not figuring out what I was doing wrong :(
BS
Balaji Sekar
Syncfusion Team
June 22, 2020 07:23 AM UTC
Hi Rui,
Based on your query, we have created a sample with RemoteSaveAdaptor in Syncfusion DataGrid it is referred the latest version of Syncfusion Essential Studio. Please refer the below sample for more information.
Sample link: https://www.syncfusion.com/downloads/support/directtrac/149859/ze/RazorpagesMSample1792996515-976710854.zip
Please get back to us, if you need further assistance.
Regards,
Balaji Sekar
SIGN IN To post a reply.
- 6 Replies
- 4 Participants
-
RM Rui Mendes
- Dec 11, 2019 07:20 PM UTC
- Jun 22, 2020 07:23 AM UTC