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

dynamically add usercontrol into radtab

6 Answers 204 Views
TabControl
This is a migrated thread and some comments may be shown as answers.
george
Top achievements
Rank 1
george asked on 12 Oct 2010, 12:15 AM
hi i am having troubles reusing the one of the tab content
i need to dynamically adding tab with the given content. but i tried all the method i can that couldnt help me loading the xaml into tab

i need to load xaml usercontrol into 2nd radtabcontrol/radtabItems
thanks in advance

<telerik:RadTabItem Padding="4 3" x:Name="radTabLoanDetails">
                <telerik:RadTabItem.Header>
                    <TextBlock Text="Loan Detials"  Margin="19 2 19 0" />
                </telerik:RadTabItem.Header>
                <telerik:RadTabItem.Content>
                    <Border   Style="{StaticResource borderStyle}" >
                        <telerik:RadTabControl x:Name="newTab" />
                    </Border>
                </telerik:RadTabItem.Content>
            </telerik:RadTabItem>

6 Answers, 1 is accepted

Sort by
0
Zarko
Telerik team
answered on 14 Oct 2010, 04:20 PM
Hi george,

 Could you please examine the attached project and if you have further questions feel free to ask?

All the best,
Zarko
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items
0
george
Top achievements
Rank 1
answered on 15 Oct 2010, 09:25 AM
thanks

its not quite what i want but it definitely give me an idea on how to use radtabcontrol
thanks very much
0
george
Top achievements
Rank 1
answered on 18 Oct 2010, 12:28 AM
Hi regarding the same question
i am able to create dynamic radtabitem by using string builder
yet i couldnt find the content inside the radtab item
i tried both
   var txtLoanTerms = items.ParentOfType<RadTabControl>().FindName(posControlInfo.TxtLoanTerms) as RadMaskedTextBox;
   var cboxRateType = items.FindName(posControlInfo.CboxRateType) as ComboBox

items as RadTabItem

thanks in advance
0
george
Top achievements
Rank 1
answered on 18 Oct 2010, 03:47 AM
dont worry
I solve the problem by adding grid inside the tab items
0
sonia agarwal
Top achievements
Rank 1
answered on 10 Feb 2014, 06:04 PM
Hi,

Pls let me know if radtab control is also a user control, then how can be the communication using MVVM. We wil create radtab usercontrol in mainwindow and do same things as it is now.
0
Zarko
Telerik team
answered on 12 Feb 2014, 05:17 PM
Hello sonia,
The RadTabControl is a custom control not a user control and to use it with MVVM you'll just need to bind its ItemsSource property to some viewModel collection. You can read a help article on the subject here.
I've attached a sample project demonstrating this so could you please examine it and if you have more questions feel free to ask.

Regards,
Zarko
Telerik

Check out the new Telerik Platform - the only modular platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native apps. Register for the free online keynote and webinar to learn more about the Platform on Wednesday, February 12, 2014 at 11:00 a.m. ET (8:00 a.m. PT).

Tags
TabControl
Asked by
george
Top achievements
Rank 1
Answers by
Zarko
Telerik team
george
Top achievements
Rank 1
sonia agarwal
Top achievements
Rank 1
Share this question
or