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

Set ScrollPosition to Active Tab on Page Load

1 Answer 94 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
Kevin Schneider
Top achievements
Rank 1
Kevin Schneider asked on 14 Jul 2008, 03:10 PM
Hello,

I have a dynamic list of tabs coming from a datasource.  When the page first loads it could be set to any of the tabs in the list (depends on value in query string).

What I want to do is make sure that the scroll position is set so the active tab is visible.

Any help is apprectiated.

Thanks.

1 Answer, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 15 Jul 2008, 07:36 AM
Hi Kevin Schneider,

You can use the scrollIntoView() client side method of the tab object. The following sample code can be used as a reference (place it in Page_Load or the DataBound event handler of your tabstrip);

string script = string.Format("Sys.Application.add_load(function(){{ $find('{0}').get_selectedTab().scrollIntoView();}});", RadTabStrip1.ClientID);  
System.Web.UI.ScriptManager.RegisterStartupScript(this, GetType(), "selectTab", script, true);  

Regards,
Albert
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
TabStrip
Asked by
Kevin Schneider
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Share this question
or