Runtime Error with LoadFromXML

5 posts, 0 answers
  1. Phillip
    Phillip avatar
    31 posts
    Member since:
    Apr 2009

    Posted 14 Sep 2009 Link to this post

    Hi,

    I'm using Q2 2009 SP1. When I call RadDock.SaveToXml(), and try and reload using RadDock.LoadFromXML() I get a reflection runtime error ; "No parameterless constructor defined for this object.".

    For info, my XML file is shown here
      <?xml version="1.0" encoding="utf-8" ?>   
    <RadDock Orientation="Horizontal" BackColor="191, 219, 254" TabIndex="0" TabStop="False">  
      <DocumentManager DocumentInsertOrder="InFront" />   
    <Controls> 
    <Telerik.WinControls.UI.Docking.ToolTabStrip BackColor="191, 219, 254" SelectedIndex="0" Size="200, 98" Location="0, 0" Name="" TabIndex="1" TabStop="False">  
      <SizeInfo SplitterCorrection="0, 0" AutoSizeScale="0, 0" />   
    <Controls> 
      <Telerik.WinControls.UI.Docking.HostWindow Name="ToolWindow1" Text="Registration Group" Size="198, 69" Location="1, 28" />   
      </Controls> 
      </Telerik.WinControls.UI.Docking.ToolTabStrip> 
    <Telerik.WinControls.UI.Docking.ToolTabStrip BackColor="191, 219, 254" SelectedIndex="0" Size="200, 99" Location="0, 101" Name="" TabIndex="2" TabStop="False">  
      <SizeInfo SplitterCorrection="0, 0" AutoSizeScale="0, 0" />   
    <Controls> 
      <Telerik.WinControls.UI.Docking.ToolWindow CloseAction="CloseAndDispose" Text="Day Register" ToolCaptionButtons="AutoHide" DocumentButtons="None" Name="toolWindow1" Size="198, 70" Location="1, 28" />   
      </Controls> 
      </Telerik.WinControls.UI.Docking.ToolTabStrip> 
      </Controls> 
      </RadDock> 
  2. Matt
    Matt avatar
    10 posts
    Member since:
    Jul 2008

    Posted 01 Oct 2009 Link to this post

    I have also been experiencing the same problem, does anyone know either the reason why this happens or a solution?
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Nikolay
    Admin
    Nikolay avatar
    1803 posts

    Posted 06 Oct 2009 Link to this post

    Hello Matt,

    This is a known issue and it will be addressed in Q3 2009. For the time being, you can use the following approach to dock a form/user control:
    FormDocument document = new FormDocument();     
    FormTool tool = new FormTool();     
        
    document.FormBorderStyle = FormBorderStyle.None;     
    document.TopLevel = false;     
    document.Dock = DockStyle.Fill;     
    document.Show();     
        
    tool.FormBorderStyle = FormBorderStyle.None;     
    tool.TopLevel = false;     
    tool.Dock = DockStyle.Fill;     
    tool.Show();     
        
    DocumentWindow documentWin = new DocumentWindow();     
    ToolWindow toolWin = new ToolWindow();     
        
    documentWin.Controls.Add(document);     
    toolWin.Controls.Add(tool);                 
        
    this.radDock1.AddDocument(documentWin, DockPosition.Right);     
    this.radDock1.DockWindow(toolWin, DockPosition.Left);    
     

    I hope this helps. If you have additional questions, feel free to contact me.

    Kind regards,
    Nikolay
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  5. Matt
    Matt avatar
    10 posts
    Member since:
    Jul 2008

    Posted 06 Oct 2009 Link to this post

    This doesn't actually answer my question.  How can I dynamically load the dock windows from my saved XML file?
  6. Nikolay
    Admin
    Nikolay avatar
    1803 posts

    Posted 06 Oct 2009 Link to this post

    Hi Matt,

    The issue that we know arises when you dock a form/usercontrol using the DockControl method and then save and try to load the RadDock layout. If you want to workaround this exception, you should use the API which I demonstrated above. When the forms/controls are docked through this API, there are no issues on my side when I save and load the RadDock layout.

    If your scenario is different, please open a new support ticket and send me a sample project. This will allow me to help you further.

    Regards,
    Nikolay
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Back to Top
UI for WinForms is Visual Studio 2017 Ready