Hello -
I thought this would be easy enough, and am still sure it must be, but .....
Can anyone post a snippet of:
1) How I would change the currently selected tab in a radribbonbar programatically?
2) Tell me which event gets fired when the selected tab changes?
My situation is that I have a standard windows tab control nested under the radribbonbar control. When the user changes the selected tab on the radribbonbar, I need to change the selected tab on the standard windows tab control as well.
Thanks much -
Jack
I thought this would be easy enough, and am still sure it must be, but .....
Can anyone post a snippet of:
1) How I would change the currently selected tab in a radribbonbar programatically?
2) Tell me which event gets fired when the selected tab changes?
My situation is that I have a standard windows tab control nested under the radribbonbar control. When the user changes the selected tab on the radribbonbar, I need to change the selected tab on the standard windows tab control as well.
Thanks much -
Jack
6 Answers, 1 is accepted
0

Richard Slade
Top achievements
Rank 2
answered on 25 Feb 2011, 11:09 PM
Hello Jack,
this should answer both your questions. It shows how to select a tab, and also registering an event handler to show when the tab has changed.
Let me know if you have any questions
Richard
this should answer both your questions. It shows how to select a tab, and also registering an event handler to show when the tab has changed.
Private
Sub
RadRibbonForm1_Load(
ByVal
sender
As
System.
Object
,
ByVal
e
As
System.EventArgs)
Handles
MyBase
.Load
AddHandler
Me
.RibbonTab1.PropertyChanged,
AddressOf
RibbonTab1_PropertyChanged
Me
.RibbonTab1.IsSelected =
True
End
Sub
Private
Sub
RibbonTab1_PropertyChanged(
ByVal
sender
As
Object
,
ByVal
e
As
PropertyChangedEventArgs)
If
e.PropertyName =
"IsSelected"
Then
MessageBox.Show(
"RibbonTab1 Selected"
)
End
If
End
Sub
Let me know if you have any questions
Richard
0

Richard Slade
Top achievements
Rank 2
answered on 28 Feb 2011, 12:23 PM
Hello,
If you found this helpful, please remember to mark as answer. If you need further assistance, please let me know
Thanks
Richard
If you found this helpful, please remember to mark as answer. If you need further assistance, please let me know
Thanks
Richard
0

Jack
Top achievements
Rank 1
answered on 28 Feb 2011, 02:11 PM
Richard -
This doesn't seem to work; (maybe I lost something in the VB to C# conversion)
However, the following event does fire, which achieves my goal:
This doesn't seem to work; (maybe I lost something in the VB to C# conversion)
public Form1()
{
InitializeComponent();
this.radRibbonBar1.PropertyChanged += new PropertyChangedEventHandler(radRibbonBar1_PropertyChanged);
this.ribbonTab1.IsSelected = true;
}
private void radRibbonBar1_PropertyChanged(object sender, EventArgs e)
{
// Never fires
}
However, the following event does fire, which achieves my goal:
private void radRibbonBar1_CommandTabSelected(object sender, Telerik.WinControls.UI.CommandTabEventArgs args)
{
if (args.CommandTab.Text == "foo1")
{
}
}
But I'm left wondering ..
Did I miss something in the translation, or is the CommandTabSelected event the one I should trap?
Thanks
Jack
0
Accepted

Richard Slade
Top achievements
Rank 2
answered on 28 Feb 2011, 02:17 PM
Hi Jack,
Yes, the problem in your code was that you were handling the event for the RadRibonBar, not the RibbonTab. The event is for each RibbonTab that you have in your RadRibbonBar, but I'm glad you have another solution which seems also to be fine.
regards,
Richard
Yes, the problem in your code was that you were handling the event for the RadRibonBar, not the RibbonTab. The event is for each RibbonTab that you have in your RadRibbonBar, but I'm glad you have another solution which seems also to be fine.
regards,
Richard
0

Jack
Top achievements
Rank 1
answered on 28 Feb 2011, 02:34 PM
Thanks Richard,
I went back and tested and your original solution works as well... sorry, havn't had my morning pot of coffee yet.
Thanks
Jack
I went back and tested and your original solution works as well... sorry, havn't had my morning pot of coffee yet.
Thanks
Jack
0

Richard Slade
Top achievements
Rank 2
answered on 28 Feb 2011, 02:48 PM
We all need our morning coffee Jack. Glad it helped. Your solution is fine too.
Thanks
Richard
Thanks
Richard