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

Change displayed tab from user control

2 Answers 51 Views
TabControl
This is a migrated thread and some comments may be shown as answers.
Chris
Top achievements
Rank 1
Chris asked on 27 Jan 2011, 12:22 AM
I'm new to the telerik control and using them with Silverlight so I apologize ahead of time if this is a simple question.

Here is my situation:

I have a page, let's call it a.xaml, that has the RadTabControl (name=MainTabControl).  This tab control has 5 tabs.  On the 3rd tab, I have an XAML user control, let's call it b.xaml, that has another XAML user control, let's call it c.xaml, that contains a Silverlight button.  When I click the button on c.xaml, I need the tab control on a.xaml to display the 1st tab. 

I have tried creating a property in the code behind for a.xaml that sets the tab control's SelectedIndex to 1 and then attempted to set that property from a click event on c.xaml.  This however, is not working.

What approach do I need to take to accomplish this navigation action or is it evey possible?

Thanks

2 Answers, 1 is accepted

Sort by
0
Petar Mladenov
Telerik team
answered on 01 Feb 2011, 12:14 PM
Hi Chris,

Please check out the attached project and let us know if it fits in your scenario. Basically, I am iterating over the visual tree until I get the RadTabControl and set its SelectedIndex property. Let us know if you need more info on this topic.

Greetings,
Petar Mladenov
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
0
Chris
Top achievements
Rank 1
answered on 03 Feb 2011, 09:31 PM
Petar,

Yes, that did exactly what I needed.  I appreciate your help and working out an entire solution to show me the example.

Chris
Tags
TabControl
Asked by
Chris
Top achievements
Rank 1
Answers by
Petar Mladenov
Telerik team
Chris
Top achievements
Rank 1
Share this question
or