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

Rad grid pagination - database calls

1 Answer 100 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Bhaskar
Top achievements
Rank 1
Bhaskar asked on 22 Dec 2011, 08:40 AM
Hi,

We are using RadGrid with EntityDatasource. We have pagination enabled on the RadGrid.
We loooked at the sql profiler and saw that RadGrid makes two calls to the database (through EntityDatasource). One call is for getting the total count (for displaying pages and count) and the second is for fetches actual records in the page.

Later when we move to the second page, I can see in the sql profiler that again two calls are made - one for count and other for all the rows of the second page.

Can we configure the radgrid such that it does not fetch the count on second or subsequent operations (like moving to next page or sorting)? Since the grid already has the total count whcih it gets on the first load, cant the radgrid maintian this and use this in the subsequent operations?

Thanks and Regards,
Bhaskar Shanbhag

PS. I am asking this question since our sql query which we use in the Entity Datasource is already very slow and calling it two times for every operation makes it slower.

1 Answer, 1 is accepted

Sort by
0
Veli
Telerik team
answered on 23 Dec 2011, 11:31 AM
Hello Bhaskar,

RadGrid always queries the database to get the most actual total item count. There is no means of turning this off from the control itself.

Veli
the Telerik team
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 their blog feed now
Tags
Grid
Asked by
Bhaskar
Top achievements
Rank 1
Answers by
Veli
Telerik team
Share this question
or