Dynamically change numbers of myUserConrols under paneGroup and pane

2 posts, 0 answers
  1. shay
    shay avatar
    16 posts
    Member since:
    Jun 2015

    Posted 03 Jul 2016 Link to this post

    I am using the structure below to get a pane that under it there is myUserControl1
    The UI will look like this:
    | my                        |
    | UserContol1         |

    The code:

    <telerik:RadSplitContainer x:Name="myContainer">
        <telerik:RadPaneGroup x:Name="myPaneGroup">
            <telerik:RadPane  Header="pane 1" >
                <MyUserConrol myUserControl1="test test" />

    The issue:
    I have a button that should change Dynamically the number of my userControl - for 

    example 4 userComtrols .i want to get this. (each userControl should be set under the same structure code that was describe before)

    | UC1      |  UC2     |              4 user controls
    | UC3      |     UC4  |

    code: (should be Dynamically )

    <telerik:RadSplitContainer x:Name="myContainer1">
        <telerik:RadPaneGroup x:Name="myPaneGroup1">
            <telerik:RadPane  Header="pane 1" >
                <MyUserConrol myUserControl1="test test" />

    <telerik:RadSplitContainer x:Name="myContainer2">
        <telerik:RadPaneGroup x:Name="myPaneGroup2">
            <telerik:RadPane  Header="pane 2" >
                <MyUserConrol myUserControl2="test test" />


    and the same for 3 and 4..

    for example 2 userComtrols) 
    | UC1       |     UC2  | 
    |               |              |
    |               |              |
    |____ ___|_______|

    what is the best way to achieve it?


  2. Nasko
    Nasko avatar
    727 posts

    Posted 06 Jul 2016 Link to this post

    Hello Shay,

    By design in the current version of RadDocking achieving any layout is possible via a static XAML, dynamically via the code behind or with the a MVVM friendly approach of using the PanesSource and a DockingPanesFactory features.

    So, basically for adding Panes dynamically you could either add them in code behind or use the MVVM approach with PanesSource - both will be suitable for your scenarion. On the following link you could find a sample project from our SDK Repository that demonstrates how PanesSource could be used in order to add dynamically Panes:

    We hope this will help you.

    Telerik by Progress
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Back to Top