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

Error on loading empty RadDocking

3 Answers 112 Views
Docking
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Matthias Bibo
Top achievements
Rank 1
Matthias Bibo asked on 12 Sep 2012, 11:22 AM

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();                                     
        }
    }            
}

3 Answers, 1 is accepted

Sort by
0
Vladi
Telerik team
answered on 17 Sep 2012, 07:40 AM
Hi Matthias,

We tried to generate the empty docking like the one you referred but when the DocumentHost is empty the generated XML code is as follows:
<?xml version="1.0" encoding="utf-8"?>
<RadDocking>
    <SplitContainers />
</RadDocking>

How are you generating the Docking xml code?

One easy way to show the document host in the xml is to put an empty RadSplitContainer in it, or remove the document host completely if you are not using it.

Greetings,
Vladi
the Telerik team

Time to cast your vote for Telerik! Tell DevPro Connections and Windows IT Pro why Telerik is your choice. Telerik is nominated in a total of 25 categories.

0
Matthias Bibo
Top achievements
Rank 1
answered on 20 Sep 2012, 09:31 AM

I submitted a demo case under the support ticket ID: 609188

0
Vladi
Telerik team
answered on 21 Sep 2012, 06:58 AM
Hi Matthias,

Thank you for sending us the project in the support ticket.

You can find the full details for the solution in the support ticket.

For reference the issue was caused by custom client ClearDocking method that clears the Docking control in which the DocumentHost was not getting cleared.

Greetings,
Vladi
the Telerik team

Time to cast your vote for Telerik! Tell DevPro Connections and Windows IT Pro why Telerik is your choice. Telerik is nominated in a total of 25 categories.

Tags
Docking
Asked by
Matthias Bibo
Top achievements
Rank 1
Answers by
Vladi
Telerik team
Matthias Bibo
Top achievements
Rank 1
Share this question
or