This is a migrated thread and some comments may be shown as answers.

Grid Pagination with Large Dataset

1 Answer 641 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Garee
Top achievements
Rank 2
Garee asked on 24 Jun 2019, 09:53 AM

Hi,

I've used the ASP.NET AJAX components for many years and am just starting to look at the UI for ASP.NET Core equivalents.

We have a large dataset (potentially hundreds of thousands of records) of historical data that we want to show in a paginated grid.The data retrieval is optimised for performance so we can retrieve any given page of data quickly, and aren't transferring large of amounts of data around unnecessarily.

In the ASP.NET AJAX grid we'd set the VirtualItemCount property which enabled the grid to initialise the pager correctly and show the total number of items and pages, and then respond to requests to retrieve the appropriate page of data in the NeedDataSource() event as the user navigated through the pages.

I can't see anything that would provide equivalent behaviour in the UI for ASP.NET Core grid though?

Thanks in advance,

Gary

1 Answer, 1 is accepted

Sort by
0
Viktor Tachev
Telerik team
answered on 27 Jun 2019, 08:36 AM
Hi Gary,

The VirtualItemCount property specifies the total number of items in the data source so the RadGrid pager can show the correct number of pages. 

With the .NET Core Grid the DataSource widget is used to retrieve the data from the server and pass it to the Grid. By default the data should be returned as DataSourceResult type. It contains Data property that holds the items returned to the Grid and Total - specifying the total number of records. 

You can keep using the logic you have already implemented for retrieving the current page from the database and populate the Data and Total fields of a DataSourceResult object that will be returned by the Read action of the Grid DataSource. 

The resources below describe in more detail how custom binding can be implemented in the Grid widget:



Give the approach a try and let me know how it works for you. In case you have additional questions do not hesitate to contact us again.


Regards,
Viktor Tachev
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Grid
Asked by
Garee
Top achievements
Rank 2
Answers by
Viktor Tachev
Telerik team
Share this question
or