- Home
- Forum
- ASP.NET Core - EJ 2
- Grid Asp.Net Core Razor Page - Crud operation
Grid Asp.Net Core Razor Page - Crud operation
Hi all,
I followed several examples on this forum on "how to use the grid with the razor page", but it doesn't work.
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?
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
SIGN IN To post a reply.
5 Replies
HJ
Hariharan J V
Syncfusion Team
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.
Sample link: https://www.syncfusion.com/downloads/support/directtrac/general/ze/testgridsyncfusion_82cf9f18-505232711.zip
Regards,
Hariharan
AG
Aguzz
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
Hello
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
Hello
TS
Thavasianand Sankaranarayanan
Syncfusion Team
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.
|
Index.cshtml.cs
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);
} |
Sample: https://www.syncfusion.com/downloads/support/forum/145785/ze/145785-razorpage-_ondemand-581387817
Please get back to us, if you need further assistance.
Regards,
Thavasianand S.
AG
Aguzz
July 11, 2019 12:14 PM UTC
Thank you,
now works well.
HJ
Hariharan J V
Syncfusion Team
July 12, 2019 09:35 AM UTC
Hi Aguzz,
We are happy to hear that your requirement has been achieved.
Regards,
Hariharan
SIGN IN To post a reply.
- 5 Replies
- 3 Participants
-
AG Aguzz
- Jul 8, 2019 05:09 PM UTC
- Jul 12, 2019 09:35 AM UTC