7 Answers, 1 is accepted
I answered in this thread as well:
http://www.telerik.com/community/forums/thread/b311D-bgmgck.aspx
If you want, you can add the UserControls directly as items of the TabControl, you just need to bind the header of the TabItem to a property that will exist on all UserControls. If we use the example from the thread, the style needs to be slightly modified :
<nav:RadTabControl x:Name="tabControl"> |
<nav:RadTabControl.ItemContainerStyle> |
<Style TargetType="nav:RadTabItem"> |
<Setter Property="Header" |
Value="{Binding Description}" /> |
<Setter Property="Conent" |
Value="{Binding}" /> |
</Style> |
</nav:RadTabControl.ItemContainerStyle> |
</nav:RadTabControl> |
I.e. you place the UserControl (the item) as content of the TabItem, while one of its properties (Description) is bound to the header.
Hopefully this will help you in your case.
Kind regards,
Miroslav
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.

Sorry to be a nuisance, but do you have a programmatic example ?
Kind Regards
David
Sorry for the delayed reply,
You can programmatically add TabItems like so:
var tabItem = new RadTabItem(); |
tabItem.Header = "My Tab Header"; |
tabItem.Content = new MyUserControl(); |
tabControl.Items.Add(tabItem); |
The first example also adds items programmatically, but uses the ItemsSource rather than directly creating and adding the items.
I hope this is what you need,
Regards,
Miroslav
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.

My usercontrols have a mixture of Windows and Telerik controls, but when I set them into the tab control like this, they only have the startup style and cannot be restyled dynamically. The rest of the controls do respond to dynamic style change.
Any ideas?
Since this is a very old post, could you please elaborate more on your scenario? What is your RadControls version? What are the controls that you use in the TabItems' Content? What do you mean by "the rest of the controls"? Is it possible for you to send us an isolated sample showing your issues?
Please note that dynamic style/theme/template change is usually considered as bad practice that may lead to various issues.
Petar Mladenov
the Telerik team

Hi Miroslav,
May be my question is not related to this thread.
I have a window with list of users. if i click on each user, currenlty i am opening a window/user cotrol to show user chat history.
Here the problem is, if we click on multiple users then multiple windows are opening and occupying the screen space.So i want to avoid this problem by using Rad Tab control.Please let me know how to add user controls/window in view model .Please provide any sample example if you have any.
Thanks,
Mohan G
Please have a look at the following three articles as they demonstrate how to bind the RadTabControl to a collection as well as how to add and remove tabs from the control:
- Data Binding
- Binding to Collection
- Add and Remove Tabs
I hope you find these resources helpful. The exact implementation really depends on the specific setup at your end, however, if you would provide more details regarding your exact requirements, I will be glad to further assist you.
Regards,
Dilyan Traykov
Telerik by Progress