dynamically add usercontrol into radtab

7 posts, 0 answers
  1. george
    george avatar
    21 posts
    Member since:
    Oct 2010

    Posted 11 Oct 2010 Link to this post

    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>
    

  2. Zarko
    Admin
    Zarko avatar
    755 posts

    Posted 14 Oct 2010 Link to this post

    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
  3. UI for WPF is Visual Studio 2017 Ready
  4. george
    george avatar
    21 posts
    Member since:
    Oct 2010

    Posted 15 Oct 2010 Link to this post

    thanks

    its not quite what i want but it definitely give me an idea on how to use radtabcontrol
    thanks very much
  5. george
    george avatar
    21 posts
    Member since:
    Oct 2010

    Posted 17 Oct 2010 Link to this post

    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
  6. george
    george avatar
    21 posts
    Member since:
    Oct 2010

    Posted 17 Oct 2010 Link to this post

    dont worry
    I solve the problem by adding grid inside the tab items
  7. sonia agarwal
    sonia agarwal avatar
    1 posts
    Member since:
    Mar 2010

    Posted 10 Feb 2014 Link to this post

    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.
  8. Zarko
    Admin
    Zarko avatar
    755 posts

    Posted 12 Feb 2014 Link to this post

    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).

Back to Top
UI for WPF is Visual Studio 2017 Ready