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

Dynamically adding Controls

1 Answer 80 Views
Docking
This is a migrated thread and some comments may be shown as answers.
Dennis
Top achievements
Rank 1
Dennis asked on 19 Feb 2011, 06:14 PM
Hi,

I want to add dynamically created controls inside Docking Control at RunTime. I have a Docking control ready at design time. I just need to add the controls created at runtime inside the Docking control. Please can you help me out achieving this?

Below is the code of the xaml file which contains the Design for the Docking Control:

<

 

 

UserControl x:Class="OSDashBoard.MainPage1"

 

 

 

xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

 

 

 

xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

 

 

 

xmlns:d="http://schemas.microsoft.com/expression/blend/2008"

 

 

 

xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"

 

 

 

mc:Ignorable="d" xmlns:telerikDocking="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Docking"

 

 

 

d:DesignWidth="640" d:DesignHeight="480">

 

 

 

 

<Grid x:Name="LayoutRoot" ShowGridLines="True">

 

 

 

 

<telerikDocking:RadDocking Margin="0,0,0,0" Grid.Row="1" Background="{x:Null}" BorderBrush="{x:Null}" Foreground="{x:Null}" HasDocumentHost="False">

 

 

 

 

<telerikDocking:RadSplitContainer InitialPosition="DockedBottom" >

 

 

 

 

<telerikDocking:RadPaneGroup>

 

 

 

 

<telerikDocking:RadPane Header="Data Chart" >

 

</telerikDocking:RadPane>

 

 

 

 

</telerikDocking:RadPaneGroup>

 

 

 

 

<telerikDocking:RadPaneGroup>

 

 

 

 

<telerikDocking:RadPane Header="Data Chart2">

 

</telerikDocking:RadPane>

 

 

 

 

</telerikDocking:RadPaneGroup>

 

 

 

 

<telerikDocking:RadPaneGroup>

 

 

 

 

<telerikDocking:RadPane Header="Detail Map">

 

</telerikDocking:RadPane>

 

 

 

 

</telerikDocking:RadPaneGroup>

 

 

 

 

</telerikDocking:RadSplitContainer>

 

 

 

 

<telerikDocking:RadSplitContainer InitialPosition="DockedBottom" >

 

 

 

 

<telerikDocking:RadPaneGroup>

 

 

 

 

<telerikDocking:RadPane Header="Data Chart" >

 

</telerikDocking:RadPane>

 

 

 

 

</telerikDocking:RadPaneGroup>

 

 

 

 

<telerikDocking:RadPaneGroup>

 

 

 

 

<telerikDocking:RadPane Header="Data Chart2">

 

</telerikDocking:RadPane>

 

 

 

 

</telerikDocking:RadPaneGroup>

 

 

 

 

<telerikDocking:RadPaneGroup>

 

 

 

 

<telerikDocking:RadPane Header="Detail Map">

 


</
telerikDocking:RadPane>

 

 

 

 

</telerikDocking:RadPaneGroup>

 

 

 

 

</telerikDocking:RadSplitContainer>

 

 

 

 

<telerikDocking:RadSplitContainer InitialPosition="DockedBottom" >

 

 

 

 

<telerikDocking:RadPaneGroup>

 

 

 

 

<telerikDocking:RadPane Header="Data Chart" >

 

</telerikDocking:RadPane>

 

 

 

 

</telerikDocking:RadPaneGroup>

 

 

 

 

<telerikDocking:RadPaneGroup>

 

 

 

 

<telerikDocking:RadPane Header="Data Chart2">

 


</
telerikDocking:RadPane>

 

 

 

 

</telerikDocking:RadPaneGroup>

 

 

 

 

<telerikDocking:RadPaneGroup>

 

 

 

 

<telerikDocking:RadPane Header="Detail Map">

 


</
telerikDocking:RadPane>

 

 

 

 

</telerikDocking:RadPaneGroup>

 

 

 

 

</telerikDocking:RadSplitContainer>

 

 

 

 

</telerikDocking:RadDocking>

 

 

 

 

</Grid>

 

 

</

 

 

UserControl>


Thanks in advance.

 

1 Answer, 1 is accepted

Sort by
0
Konstantina
Telerik team
answered on 23 Feb 2011, 11:04 AM
Hi David,

In order to achieve that you will have to give x:Name to the Panes, in which you want to add controls and use their Content property. You can find more information in this help article.

Please let us know if you have further questions.

Regards,
Konstantina
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
Tags
Docking
Asked by
Dennis
Top achievements
Rank 1
Answers by
Konstantina
Telerik team
Share this question
or