Hello,
when I load an empty Raddocking I get the following error:
{System.ArgumentOutOfRangeException: Das angegebene Argument liegt außerhalb des gültigen Wertebereichs.
Parametername: elementTypeName
bei Telerik.Windows.Controls.Docking.DockingLayoutFactory.GetElementByTypeName(IGeneratedItemsFactory factory, String elementTypeName)
bei Telerik.Windows.Controls.Docking.DockingLayoutFactory.LoadSplitContainer(XmlReader reader)
bei Telerik.Windows.Controls.Docking.DockingLayoutFactory.LoadDocking(XmlReader reader)
bei Telerik.Windows.Controls.RadDocking.LoadLayout(Stream source, Boolean raiseEventsIfNoSerializationTag)
bei Telerik.Windows.Controls.RadDocking.LoadLayout(Stream source)
bei Bdl.DialogCrm.Silverlight.Core.ViewManagement.ViewManager.LoadLayout(BDLDocking docking, String layoutName, String attribute)
bei Bdl.DialogCrm.Silverlight.UserControls.BDLDockingControl.LoadStdLayout()
bei Bdl.DialogCrm.Silverlight.UserControls.BDLDockingControl.DockTarget_Loaded(Object sender, RoutedEventArgs e)
bei MS.Internal.CoreInvokeHandler.InvokeEventHandler(UInt32 typeIndex, Delegate handlerDelegate, Object sender, Object args)
bei MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, Int32 actualArgsTypeIndex, String eventName, UInt32 flags)}
I clear the docking (like here in the forum described).
But when I want to load the empty Raddocking (we save the xml in database) I get an error. The empty Raddocking looks like following:
<BDLDocking>
<DocumentHost></DocumentHost>
<SplitContainers></SplitContainers>
</BDLDocking>
What I´m doing wrong?
Here is the code....
public
void
LoadDocking(BDLDocking docking)
{
string layoutConfig = "
<BDLDocking>
<DocumentHost></DocumentHost>
<SplitContainers></SplitContainers>
</BDLDocking>";
this
.ClearDocking(docking);
using
(Stream stream =
new
MemoryStream(Encoding.UTF8.GetBytes(layoutConfig)))
{
stream.Seek(0, SeekOrigin.Begin);
docking.LoadLayout(stream); <-----Exception occurs
...
}
....
}
public
void
ClearDocking(BDLDocking docking)
{
if
(docking !=
null
)
{
foreach
(var pane
in
docking.Panes.ToList())
{
List<UIElement> disposableControls =
new
List<UIElement>();
ViewManager.Instance.FindControls<IDisposable>(pane, disposableControls);
foreach
(var control
in
disposableControls)
{
if
(control !=
null
)
{
(control
as
IDisposable).Dispose();
}
}
pane.IsHidden =
true
;
pane.Content =
null
;
pane.RemoveFromParent();
}
}
}