RadRibbon Bar Active Tab

5 posts, 0 answers
  1. Jonathan
    Jonathan avatar
    1 posts
    Member since:
    Sep 2008

    Posted 09 Jan 2009 Link to this post

    All,

    Thanks for the opportunity to use this control. I have a question regarding the active tab for the RadRibbonBar. I have many forms in my application and when I open certain forms, I would like to change the active tab of the RibbonBar. For instance, say I have a tab name File and another one named Actions. The default form load tab opens with file as the active tab. When I open a form, I would like to change the default tab to the actions tab and make it viewable. I hope my question is clear enough. If not, I will elaborate more. Thank you for your time in this matter.

    JPADKINS
  2. Nikolay
    Admin
    Nikolay avatar
    1803 posts

    Posted 12 Jan 2009 Link to this post

    Hello Jonathan,

    Thank you for contacting us.

    In order to set a tab as the active RadRibbonBar tab, you should set its IsSelected property to true:
    tabItem3.IsSelected = true

    Please note that Microsoft suggests in the Office 2007UI Design Guidelines that:
    "Displaying Tabs section: The leftmost tab MUST be selected every time the application is started". So, if you want to be compliant with these guidelines, you should always have the first tab initially selected.

    Hope this helps. If you have additional questions, feel free to contact me.

    All the best,
    Nikolay
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Kenneth Jackson
    Kenneth Jackson avatar
    60 posts
    Member since:
    Dec 2007

    Posted 14 Jan 2009 Link to this post

    I had the same question on this issue as Jonathan.

    I tried to use the solution , but the only tabs i have exposed from the radribbonbar are in the commandtabs collection.
    They have a tab property with many other properties but none of those properties are IsSelected.

    I've tried using the focus method among many others including focusing internal elements of the tab but
    I cannot get a tab to focus programmatically.

    Am I using the wrong objects to achieve this ? Which other tab objects/collection is available through
    the ribbonbar other than the contextual tabs ?
  5. Kenneth Jackson
    Kenneth Jackson avatar
    60 posts
    Member since:
    Dec 2007

    Posted 14 Jan 2009 Link to this post

    Ok , if I create a TabItem object and set that equal to the commandtab.tab
    object then I can use the IsSelected property on the object.

    I cannot however if I try to directly access the property as CommandTab.Tab.IsSelected.

    So problem solved but is there no short way to do this directly through the commandtab.tab object
    or from the ribbonbar somehow instead of creating an extra object to access the correct property ?

  6. Peter
    Admin
    Peter avatar
    1148 posts

    Posted 15 Jan 2009 Link to this post

    Hello Kenneth Jackson,

    Thank you for contacting us. Please see your Designer.cs (or .VB file) and in particular the initialization code for the RadRibbonBar:

    private TabItem tabItem1; 
    ..... 
    this.tabItem1 = new Telerik.WinControls.UI.TabItem(); 
    ..... 
    radRibbonBarCommandTab1.Tab = this.tabItem1; 
    ..... 

    You should set .IsSelected for TabItem1 that represents a tab in the RibbonBar.

    Another way to set the selected tab in the RibbonBar is to use the following code snippet:

    this.radRibbonBar1.RibbonBarElement.TabStripElement.SelectedTab = 
                    this.radRibbonBar1.RibbonBarElement.TabStripElement.Items[0]; 

    Hope this helps. Do not hesitate to contact us if you have other questions.

    All the best,
    Peter
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Back to Top
UI for WinForms is Visual Studio 2017 Ready