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

[Solved] Querying only for a single page of data when using normal ajax binding in Grid

2 Answers 81 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
James
Top achievements
Rank 1
James asked on 30 Apr 2012, 07:29 AM
Hi,

I am using Telerik Grid on my website, and I was wondering if I can use the normal ajax binding (not the custom one) to grab data from the server without the server loading the whole table from the database.

E.g:

My grid has a column called Customers. When I click on the header, the code makes a call to the server to grab the data. By default, the server will then query for the whole table from the database, before using paging to return only the data on the page. Is it possible for it to query the database only for the data on the page? If it is, how can it be done? It'll be very helpful if you can show me the example in code.

I have done this using the custom ajax binding mentioned here: http://demos.telerik.com/aspnet-mvc/razor/grid/custombinding but I would like to do it using the normal/simple ajax binding.

A side question: If I used custom ajax binding for one thing (e.g: paging), is it possible to then use the normal ajax binding for something else (e.g: sorting/filtering)?

Thanks!

2 Answers, 1 is accepted

Sort by
0
Pechka
Top achievements
Rank 1
answered on 30 Apr 2012, 08:22 AM
Hi

http://www.telerik.com/help/aspnet-mvc/telerik-ui-components-grid-data-binding-ajax-binding.html 

Check the Important section under the first step of configuring the Ajax binding.
0
James
Top achievements
Rank 1
answered on 01 May 2012, 12:19 AM
Hi Pechka,

Thanks for the link. I read it, and while it does say that paging/filtering/sorting happens in the background when I'm using the default ajax binding, it doesn't answer my questions. My questions were:

1. Is it possible to query the database only for the items on the page when I'm using the default ajax binding? If it is possible, how?
2. Can I mix custom ajax binding with the default ajax binding? If I can, how?

Thanks!
Tags
Grid
Asked by
James
Top achievements
Rank 1
Answers by
Pechka
Top achievements
Rank 1
James
Top achievements
Rank 1
Share this question
or