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

RadRibbon Bar Active Tab

4 Answers 723 Views
RibbonBar
This is a migrated thread and some comments may be shown as answers.
Jonathan
Top achievements
Rank 1
Jonathan asked on 09 Jan 2009, 09:57 PM
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

4 Answers, 1 is accepted

Sort by
0
Nikolay
Telerik team
answered on 12 Jan 2009, 04:40 PM
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.
0
Kenneth Jackson
Top achievements
Rank 1
answered on 14 Jan 2009, 12:58 PM
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 ?
0
Kenneth Jackson
Top achievements
Rank 1
answered on 14 Jan 2009, 01:12 PM
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 ?

0
Peter
Telerik team
answered on 15 Jan 2009, 12:26 PM
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.
Tags
RibbonBar
Asked by
Jonathan
Top achievements
Rank 1
Answers by
Nikolay
Telerik team
Kenneth Jackson
Top achievements
Rank 1
Peter
Telerik team
Share this question
or