Error on loading empty RadDocking

4 posts, 0 answers
  1. Matthias Bibo
    Matthias Bibo avatar
    72 posts
    Member since:
    Mar 2010

    Posted 12 Sep 2012 Link to this post

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

  2. Vladi
    Admin
    Vladi avatar
    744 posts

    Posted 17 Sep 2012 Link to this post

    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.

  3. DevCraft banner
  4. Matthias Bibo
    Matthias Bibo avatar
    72 posts
    Member since:
    Mar 2010

    Posted 20 Sep 2012 Link to this post

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

  5. Vladi
    Admin
    Vladi avatar
    744 posts

    Posted 21 Sep 2012 Link to this post

    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.

Back to Top