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

[Solved] Tabstrip resets to tab 1 when action taken in embedded grid (sort, filter, etc)

3 Answers 81 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Gene
Top achievements
Rank 1
Gene asked on 18 Apr 2012, 02:49 PM
I have a tab strip with grid controls on each tab. If I use any of the grid controls like sort or filter, the page returns to tab 1. Is there any variable that can be passed back to the controller to indicate the current selected tab?

3 Answers, 1 is accepted

Sort by
0
Accepted
Pechka
Top achievements
Rank 1
answered on 18 Apr 2012, 03:45 PM
1) Use Ajax binding for the Grid
2)Play with some variables and the .SelectedIndex() server method of the tabstrip
3) Use the client API of the tabstrip - http://demos.telerik.com/aspnet-mvc/tabstrip/clientsideapi 
0
Gene
Top achievements
Rank 1
answered on 18 Apr 2012, 09:24 PM
Hi Pechka ,

Would it be possible to provide an example using option 2 above (Play with some variables and the .SelectedIndex() server method of the tabstrip)

Thanks,
Gene

To be more specific, I can set the desired tab with .SelectedIndex(@ViewData["SelectedIndex"] as int).
The question is, how do I set the ViewData["SelectedIndex"] to contain the last selected tab?
0
Gene
Top achievements
Rank 1
answered on 19 Apr 2012, 03:20 PM
I have resolved the issue with Javascript and cookies. The link which proviided direction for this is:
http://stackoverflow.com/questions/3581976/how-can-i-make-telerik-tabstrip-tabs-persist-between-page-requests
It was necessary to use Document.cookies instead of $.cookie (jQuery). For some reason, the jQuery version would not run. I suspect the result of a conflict between Telerik and jQuery.
Anyway, thank you for your assistance!
Tags
TabStrip
Asked by
Gene
Top achievements
Rank 1
Answers by
Pechka
Top achievements
Rank 1
Gene
Top achievements
Rank 1
Share this question
or