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

Runtime Error with LoadFromXML

4 Answers 145 Views
Dock
This is a migrated thread and some comments may be shown as answers.
Phillip
Top achievements
Rank 1
Phillip asked on 14 Sep 2009, 01:41 PM
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> 

4 Answers, 1 is accepted

Sort by
0
Matt
Top achievements
Rank 1
answered on 01 Oct 2009, 07:53 AM
I have also been experiencing the same problem, does anyone know either the reason why this happens or a solution?
0
Nikolay
Telerik team
answered on 06 Oct 2009, 10:53 AM
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.
0
Matt
Top achievements
Rank 1
answered on 06 Oct 2009, 11:04 AM
This doesn't actually answer my question.  How can I dynamically load the dock windows from my saved XML file?
0
Nikolay
Telerik team
answered on 06 Oct 2009, 11:32 AM
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.
Tags
Dock
Asked by
Phillip
Top achievements
Rank 1
Answers by
Matt
Top achievements
Rank 1
Nikolay
Telerik team
Share this question
or