Hi,
I created a Silverlight User Control of type RadPane.
In the constructor of the MainPage, I've added this control into a RadGroupPanel many times. When i'm trying to "undock" one of the RadPane, an exception is thrown saying that the LayoutRoot already exist.
RadPaneTest :
MainPage.xaml.cs
Can you tell me what i'm doing wrong ?
Thanks.
Sébastien Chicoine
I created a Silverlight User Control of type RadPane.
In the constructor of the MainPage, I've added this control into a RadGroupPanel many times. When i'm trying to "undock" one of the RadPane, an exception is thrown saying that the LayoutRoot already exist.
RadPaneTest :
<
telerik:RadPane
x:Class
=
"PbDocking.RadPaneTest"
xmlns:telerik
=
"http://schemas.telerik.com/2008/xaml/presentation"
mc:Ignorable
=
"d"
Header
=
"RadPaneTest"
>
<
telerik:RadPane.Content
>
<
Grid
x:Name
=
"LayoutRoot"
Background
=
"White"
>
<
TextBlock
x:Name
=
"TxtText"
Text
=
"Message !!"
HorizontalAlignment
=
"Center"
VerticalAlignment
=
"Center"
FontWeight
=
"Bold"
/>
</
Grid
>
</
telerik:RadPane.Content
>
</
telerik:RadPane
>
MainPage.xaml.cs
using
System;
using
System.Collections.Generic;
using
System.Linq;
using
System.Net;
using
System.Windows;
using
System.Windows.Controls;
using
System.Windows.Documents;
using
System.Windows.Input;
using
System.Windows.Media;
using
System.Windows.Media.Animation;
using
System.Windows.Shapes;
using
Telerik.Windows.Controls;
using
Telerik.Windows.Controls.Docking;
namespace
PbDocking
{
public
partial
class
MainPage : UserControl
{
RadDocking radDocking;
DocumentHost documentHost;
RadSplitContainer radSplitContainer;
RadPaneGroup radPaneGroup;
public
MainPage()
{
radDocking =
new
RadDocking();
documentHost =
new
DocumentHost();
radSplitContainer =
new
RadSplitContainer();
radPaneGroup =
new
RadPaneGroup();
for
(
int
i = 0; i < 10; ++i)
{
RadPaneTest rpt =
new
RadPaneTest();
rpt.TxtText.Text =
"Message "
+ i.ToString() +
" !"
;
radPaneGroup.AddItem(rpt, DockPosition.Center);
}
radSplitContainer.Items.Add(radPaneGroup);
documentHost.AddSplitItem(radSplitContainer);
radDocking.DocumentHost = documentHost;
this
.Content = radDocking;
}
}
}
Can you tell me what i'm doing wrong ?
Thanks.
Sébastien Chicoine