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

Dynamic RadGrid and web api issue with pagination

2 Answers 155 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Smart
Top achievements
Rank 1
Smart asked on 29 Oct 2013, 02:20 PM
Hello All,

First Issue
 I am trying to use RadGrid and the data source for this comes from a webapi. I have successfully added the data to the RadGrid. But, the issues is that there are over 10,000 records the api returns and takes 20-30 min to load the RadGrid. To make things easy on data binding and loading, I have tried to create dynamic RadGrid. The idea is to call the api and return only 50 records on every page change. The pagination wont show because, I am retrieving only  50 records every time. So the first page shows up with 50 records and I cannot paginate as there are no pages showing up.

2nd issue
 
I need to add a search box and allow searching for a record. I could achieve this when I created radgrid using ASPX. But, dynamic creation of radgrid, I have to call the api's every time and load the grid again and then search for the data which (according to me) is inefficient. The same with export to CSV. I have to recreate the radgrid every time.


Are there any better ways to do this without dynamic radgrid, and still be able to paginate and call the api when ever the next page is clicked. I am using C#. I understand it will be hard for you all to picture what I am  trying to say, but, I really appreciate any help or suggestions or questions that guide me in the right direction.

Thank you in advance

2 Answers, 1 is accepted

Sort by
0
Antonio Stoilkov
Telerik team
answered on 01 Nov 2013, 09:53 AM
Hi Satish,

Based on your description I would suggest two possible approaches that you could use to achieve the desired functionality.

  • Virtualization - the functionality enables you to bind to huge amount of data and does not suffer performance hits. The idea behind the feature is binding only the visible rows and requesting data when needed by firing a callback. This approach will allow you to call the WebAPI on the client and bind the RadGrid on the client and resolve the issue with going back to the server for searching
  • http://demos.telerik.com/aspnet-ajax/grid/examples/performance/virtualization/defaultcs.aspx

Regards,
Antonio Stoilkov
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
Smart
Top achievements
Rank 1
answered on 06 Nov 2013, 05:28 PM
Thank you Antonio

I went about using Custom Paging, because 
Virtualization is only available on Telerik 2013 version. I using 2012. But nevertheless it custom paging worked. 

I have another issues with paging please see the link below, when you get time

http://www.telerik.com/community/forums/aspnet-ajax/grid/paging-backward-goes-back-to-page-1.aspx




Tags
Grid
Asked by
Smart
Top achievements
Rank 1
Answers by
Antonio Stoilkov
Telerik team
Smart
Top achievements
Rank 1
Share this question
or