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

Save Layout with Controls??

1 Answer 27 Views
Docking
This is a migrated thread and some comments may be shown as answers.
ITA
Top achievements
Rank 1
ITA asked on 06 Feb 2013, 12:23 PM
Hi,

i add a RadPane dynamically by clicking a button.
{
RadPane radPane = new RadPane() { Content = new Controls.LayoutData() };
RadPaneGroup radPaneGroup = new RadPaneGroup();
RadSplitContainer radSplitContainer = new RadSplitContainer() { InitialPosition = DockState.FloatingDockable };
radPaneGroup.Items.Add(radPane);
radSplitContainer.Items.Add(radPaneGroup);
Docking.Items.Add(radSplitContainer);
}

As you can see the Content of the RadPane ist a Usercontrol called "Controls.LayoutData". In this Control i can choose a Report,
which is shown in the Control.

But how do i save this layout?

This way just save the Layout with empty RadPanes:
try
{
      MemoryStream stream = new MemoryStream();
      this.Docking.SaveLayout(stream);
 
      stream.Seek(0, SeekOrigin.Begin);
      StreamReader reader = new StreamReader(stream);
      string xml_s = reader.ReadToEnd();
 
      string path_s = Klassen.helper.WPFAnwendung_Path() + "/Layout/laoyut.xml";
      using (StreamWriter Mywriter = new StreamWriter(@path_s))
      {
           Mywriter.Write(xml_s);
           Mywriter.Close();
           Mywriter.Dispose();
       }
}

how do I save the contents of the newly created/all RadPanes????

Thanks a lot
Best Regards
Rene

1 Answer, 1 is accepted

Sort by
0
Boyan
Telerik team
answered on 11 Feb 2013, 11:45 AM
Hello Rene,

You should set the SerializationTag to the added elements in order to save their Content properly. For more information check this help article.

Regards,
Boyan
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
Docking
Asked by
ITA
Top achievements
Rank 1
Answers by
Boyan
Telerik team
Share this question
or