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

Grid Asp.Net Core Razor Page - Crud operation

Thread ID:





145785 Jul 8,2019 05:09 PM UTC Jul 12,2019 09:35 AM UTC ASP.NET Core - EJ 2 5
Tags: DataGrid
Asked On July 8, 2019 05:09 PM UTC

Hi all,
I followed several examples on this forum on "how to use the grid with the razor page", but it doesn't work.
The test project is attached.
If I use the example using the datasource binding, the grid fills up,
If I use <e-data-manager> the events don't fired and the grid "no record to display"... how can I solve this problem?
Thank you

Attachment: testgridsyncfusion_82cf9f18.zip

Hariharan J V [Syncfusion]
Replied On July 9, 2019 01:41 PM UTC

Hi Aguzz, 

Greetings from the Syncfusion support,  

We have validated your query provided information and we have modified the sample with CRUD operation on EJ2 Grid in Razor. Please refer the below sample for more information. 


Replied On July 10, 2019 09:26 AM UTC

Hi, thanks for the quick answer.
I tested your example and now the Crud operation works well,
But I wanted to tell you, that if you enable allowSorting = "true" in your example it doesn't work

Thanks again


Thavasianand Sankaranarayanan [Syncfusion]
Replied On July 11, 2019 10:20 AM UTC

Hi Aguzz, 

We have validated your query. While using remote data you need to handle the on demand actions in server side. Please find the below code snippet and sample for more information. 


public JsonResult OnPostDataSource([FromBody]DataManagerRequest dm) 
            IEnumerable DataSource = OrdersDetails.GetAllRecords(); 
            DataOperations operation = new DataOperations(); 
            if (dm.Search != null && dm.Search.Count > 0) 
                DataSource = operation.PerformSearching(DataSource, dm.Search);  //Search 
            if (dm.Sorted != null && dm.Sorted.Count > 0) //Sorting 
                DataSource = operation.PerformSorting(DataSource, dm.Sorted); 
            if (dm.Where != null && dm.Where.Count > 0) //Filtering 
                DataSource = operation.PerformFiltering(DataSource, dm.Where, dm.Where[0].Operator); 
            int count = DataSource.Cast<OrdersDetails>().Count(); 
            if (dm.Skip != 0) 
                DataSource = operation.PerformSkip(DataSource, dm.Skip);   //Paging 
            if (dm.Take != 0) 
                DataSource = operation.PerformTake(DataSource, dm.Take); 
            return dm.RequiresCounts ? new JsonResult(new { result = DataSource, count = count }) : new JsonResult(DataSource); 

Please get back to us, if you need further assistance. 

Thavasianand S. 

Replied On July 11, 2019 12:14 PM UTC

Thank you, now works well.

Hariharan J V [Syncfusion]
Replied On July 12, 2019 09:35 AM UTC

Hi Aguzz, 
 We are happy to hear that your requirement has been achieved. 


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