This question is locked. New answers and comments are not allowed.
I'd like a grid to have the same page and row selected when they come back to the page that they had when they left. I figured I could keep the page and row ID in a cookie and restore them when the grid loads again, but there's a few problems.
For one, I can't find a method to get the current page, only set the page. Also there's no distinct event for changing a page, just row data binding.
Also I don't see a client side method on the grid to set the selected row.
Is what I'm trying to do possible?
For one, I can't find a method to get the current page, only set the page. Also there's no distinct event for changing a page, just row data binding.
Also I don't see a client side method on the grid to set the selected row.
Is what I'm trying to do possible?
5 Answers, 1 is accepted
0
Hi David,
I hope this helps,
Atanas Korchev
the Telerik team
You can use the pageTo() JavaScript method to set the current page on the client-side.
We currently do not support setting the current page from the server side. The good news is that we recently implemented this feature and you will be able to set the current page from the paging configuration. Let me know if you need this functionality and I will send you our latest internal build.
Indeed there is no client-side method to select a row. You can use jQuery to add the required CSS class:
$('#Grid').find('tbody tr:eq(1)').addClass('t-state-selected')
Atanas Korchev
the Telerik team
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 Public Issue Tracking
system and vote to affect the priority of the items
0
David
Top achievements
Rank 1
answered on 27 Sep 2010, 05:59 PM
I found the pageTo() method. I was actually looking for a way to get the current page and react to the user switching pages. (In order to save the current page and bring it back later)
I will look into the jQuery statement.
I will look into the jQuery statement.
0
Hi David,
Atanas Korchev
the Telerik team
The current page can be retrieved from the currentPage field:
var currentPage = grid.currentPage;
Atanas Korchev
the Telerik team
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 Public Issue Tracking
system and vote to affect the priority of the items
0
David
Top achievements
Rank 1
answered on 01 Oct 2010, 06:45 PM
Thanks. Didn't find that in the documentation. Is there an event that lets you know when a user has switched pages? I would also need this event in order to persist the current page.
(By the way, sorry for not posting this in the Grid forum)
(By the way, sorry for not posting this in the Grid forum)
0
Hi David,
Atanas Korchev
the Telerik team
The OnDataBinding event is raised whenever the grid needs to bind - paging, sorting, filtering etc.
Regards,Atanas Korchev
the Telerik team
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 Public Issue Tracking
system and vote to affect the priority of the items