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

Setting Active TabItem

5 Answers 373 Views
TabControl
This is a migrated thread and some comments may be shown as answers.
ktang
Top achievements
Rank 1
ktang asked on 03 Aug 2009, 09:42 PM
Hi,

I have a question on how to programmatic select a tab to show on load or after an event.  For example, i have 3 tabitems in my tab, and i want to show the 2nd item on page load.  How can I do that?

Thank you

Kenneth

5 Answers, 1 is accepted

Sort by
0
Ivan
Telerik team
answered on 06 Aug 2009, 06:51 PM
Hello Kenneth,

Thank you for your interest in the RadTabControl.

There are some ways to initialize the initial selected tab item:
  • If you create the RadTabControl inside the Xaml-code.
    Here you can use one of:
    • RadTabControl's SelectedIndex property as:
       
      <telerikNavigation:RadTabControl SelectedIndex="2" 
       
    • RadTabItem's IsSelected property as:
       
      <telerikNavigation:RadTabItem IsSelected="True" 
       
  • If you create the RadTabControl in code behind.
    Here you can use:
    • RadTabControl's SelectedIndex property as:
       
      tabControl.SelectedIndex = 1; 
       

We prepared and attached here an example where both techniques are demonstrated. Please give it a try and let us know if you have other questions.

Greetings,
Ivan
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
ktang
Top achievements
Rank 1
answered on 06 Aug 2009, 06:56 PM
Thanks Ivan, i actually figured it out already, should have update this post but I totoally forgot already.  I guess when I post this message I haven't figured out that the SelectedIndex is not 0 base.  I keep changing the SelectedIndex to 1 and thinking it would go to the 2nd tab, but finally by guessing I got it working.

Thank you
Kenneth
0
Julio
Top achievements
Rank 1
answered on 11 Jul 2013, 05:38 AM
Hi

I have a different issue,  I have RadTabControl with the following configuration in a silverlight project:

1. The RadTabControl is inside a dataform control.
2. It has 3 RadTabControlItems.  There is not tabs added dynamically.
3. There is no nothing controlling or manage SelectIndexChanged.

Issue:

When the user selects tab 2 for example, the system load tab 2 but after tab 2 is loaded, automatically it gets change to Tab 1.

Is there any way to avoid this issue?

0
Stefan
Telerik team
answered on 11 Jul 2013, 02:14 PM
Hello Julio,

Unfortunately I was not able to reproduce the described behavior. I attached the sample project I used for testing the issue. Please feel free to modify it in order to show us how to reproduce the described behavior.

Regards,
Stefan
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Julio
Top achievements
Rank 1
answered on 18 Jul 2013, 12:40 AM
Thanks I will review the sample.
Tags
TabControl
Asked by
ktang
Top achievements
Rank 1
Answers by
Ivan
Telerik team
ktang
Top achievements
Rank 1
Julio
Top achievements
Rank 1
Stefan
Telerik team
Share this question
or