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

Programmatically Select a Ribbon Tab

8 Answers 1114 Views
RibbonBar
This is a migrated thread and some comments may be shown as answers.
Chris Kirkman
Top achievements
Rank 1
Chris Kirkman asked on 19 Jul 2010, 02:21 PM
Anyone know how to do this?  I have several ribbon tabs on my ribbon bar control.  I want to automatically set focus to one of the ribbon tabs based on interaction elsewhere in my application.  There doesn't seem to be an obvious method to select one of the ribbon tabs as the currently selected one.

8 Answers, 1 is accepted

Sort by
1
Chris Kirkman
Top achievements
Rank 1
answered on 19 Jul 2010, 02:26 PM
Ok, found it myself.

RibbonTab.IsSelected = true;

This applies focus.  This seems a bit unorthodox.  I would have assumed a method such as RibbonTab.Select() be used instead.
0
tphan
Top achievements
Rank 1
answered on 27 Sep 2012, 03:55 AM
Thanks ! It works for me.
0
Gabriel
Top achievements
Rank 1
answered on 06 Mar 2014, 08:02 PM
Worked for me too :)

 

0
Curtis
Top achievements
Rank 1
Iron
Iron
Veteran
answered on 29 Sep 2015, 07:25 PM

Not only would i have expected the object to have a method to indicate selection, i'd have expected some type of property or method from the parent as well:

myRadRibbonTab.Selected()   ' Tell's the parent Ribbon Tab i'm the one selected thus setting the tab

-or-

myRadRibbonBar.SelectedTab() = myRadRibbonTab   ' Sets the Tab

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 30 Sep 2015, 01:35 PM
Hello Curtis,

Thank you for writing.

You can specify which tab is selected by setting the IsSelected property to true for the desired RibbonTab. Alternatively, you can change the selected tab at control level as well by setting the RadRibbonBar.RibbonBarElement.TabStripElement.SelectedItem property:
this.radRibbonBar1.RibbonBarElement.TabStripElement.SelectedItem = this.ribbonTab4;

I hope this information helps. Should you have further questions I would be glad to help.
 
Regards,
Dess
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Mahmoud
Top achievements
Rank 1
answered on 17 Feb 2016, 07:20 AM

Hello

You can use this code 

this.ribbonTab3.IsSelected = true;
this.ribbonTab3.Owner.Focus();
this.radRibbonBar1.Refresh();

 

0
Hristo
Telerik team
answered on 17 Feb 2016, 01:45 PM
Hello Mahmoud,

Thank you for writing.

Indeed, this is a valid solution in case you would like to focus on the tab strip, otherwise setting the IsSelected property of the ribbon tab is enough.

I hope this helps. Please let me know if you need additional information.

Regards,
Hristo Merdjanov
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Yuji
Top achievements
Rank 1
Iron
answered on 27 Mar 2023, 01:27 PM

Try this

this.ribbon1.ActiveTab = this.ribbonTab1;

 

 

Dess | Tech Support Engineer, Principal
Telerik team
commented on 28 Mar 2023, 08:47 AM

Hi, Yuji,

RadRibbonBar from the Telerik UI for WinForms suite doesn't offer ActiveTab property. If you need to select a tab, feel free to use the RibbonTab.IsSelected property.

Tags
RibbonBar
Asked by
Chris Kirkman
Top achievements
Rank 1
Answers by
Chris Kirkman
Top achievements
Rank 1
tphan
Top achievements
Rank 1
Gabriel
Top achievements
Rank 1
Curtis
Top achievements
Rank 1
Iron
Iron
Veteran
Dess | Tech Support Engineer, Principal
Telerik team
Mahmoud
Top achievements
Rank 1
Hristo
Telerik team
Yuji
Top achievements
Rank 1
Iron
Share this question
or