Setting Active TabItem

6 posts, 0 answers
  1. ktang
    ktang avatar
    6 posts
    Member since:
    Jul 2007

    Posted 03 Aug 2009 Link to this post

    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
  2. Ivan
    Admin
    Ivan avatar
    519 posts

    Posted 06 Aug 2009 Link to this post

    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.
  3. DevCraft banner
  4. ktang
    ktang avatar
    6 posts
    Member since:
    Jul 2007

    Posted 06 Aug 2009 Link to this post

    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
  5. Julio
    Julio avatar
    8 posts
    Member since:
    Feb 2012

    Posted 11 Jul 2013 Link to this post

    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?

  6. Stefan
    Admin
    Stefan avatar
    89 posts

    Posted 11 Jul 2013 Link to this post

    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 >>
  7. Julio
    Julio avatar
    8 posts
    Member since:
    Feb 2012

    Posted 17 Jul 2013 Link to this post

    Thanks I will review the sample.
Back to Top
DevCraft banner