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

Dynamically change numbers of myUserConrols under paneGroup and pane

1 Answer 31 Views
Docking
This is a migrated thread and some comments may be shown as answers.
shay
Top achievements
Rank 1
shay asked on 03 Jul 2016, 06:16 AM

Hi, 
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" />
        </telerik:RadPane>
    </telerik:RadPaneGroup>
</telerik:RadSplitContainer>

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:RadPane>
    </telerik:RadPaneGroup>
</telerik:RadSplitContainer>

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

 

and the same for 3 and 4..

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

what is the best way to achieve it?

thanks

1 Answer, 1 is accepted

Sort by
0
Nasko
Telerik team
answered on 06 Jul 2016, 12:46 PM
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:
https://github.com/telerik/xaml-sdk/tree/master/Docking/NestedDockingWithPanesSource

We hope this will help you.


Regards,
Nasko
Telerik by Progress
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Tags
Docking
Asked by
shay
Top achievements
Rank 1
Answers by
Nasko
Telerik team
Share this question
or