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

Grid AJAX binding and paging

2 Answers 133 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Nikita
Top achievements
Rank 1
Iron
Nikita asked on 31 May 2016, 03:43 PM

I have a form that is used to search for people's names and display them in an Telerik MVC Grid. Grid uses Ajax binding and paging. I have a problem with paging. My situation is that when a user searches for names and the search returns say 3 pages of results. The user flips a page and performs a search again narrowing it down to say 1 page of the results, the grid refreshes but stays on the flipped page which shows up empty because again there is only 1 page of results. Is there a way to reset the paging after each search? I handle the searching explicitly on client side by calling $("#gridElement").data("kendoGrid").dataSource.read();

Any help is appreciated.

Nik

2 Answers, 1 is accepted

Sort by
0
Accepted
Radoslav
Telerik team
answered on 02 Jun 2016, 08:14 AM
Hello Nikita,

To achieve the desired functionality you can try resetting the page manually just before filtering:
$("#grid").data("kendoGrid").dataSource.page(1);

On the following link I attached a small example which demonstrates the described approach.
http://dojo.telerik.com/eseSu/5

If you need further assistance, do not hesitate to contact us again.

Regards,
Radoslav
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Nikita
Top achievements
Rank 1
Iron
answered on 06 Jun 2016, 02:42 PM
That was helpful, thank you.
Tags
Grid
Asked by
Nikita
Top achievements
Rank 1
Iron
Answers by
Radoslav
Telerik team
Nikita
Top achievements
Rank 1
Iron
Share this question
or