标签:
一、演示概述/// <summary> /// 将RadDocking的布局信息转换为字符串。 /// </summary> /// <returns></returns> private string SaveLayoutAsString() { MemoryStream stream = new MemoryStream(); this.RadDocking.SaveLayout(stream); stream.Seek(0, SeekOrigin.Begin); StreamReader reader = new StreamReader(stream); return reader.ReadToEnd(); }
/// <summary> /// 从字符串中加载RadDocking的布局信息。 /// </summary> /// <param name="xml"></param> private void LoadLayoutFromString(string xml) { using (Stream stream = new MemoryStream(Encoding.UTF8.GetBytes(xml))) { stream.Seek(0, SeekOrigin.Begin); this.RadDocking.LoadLayout(stream); } }
<?xml version="1.0" encoding="utf-8"?> <RadDocking> <DocumentHost> <RadSplitContainer> <Items> <RadPaneGroup SelectedIndex="0"> <Items> <RadPane SerializationTag="LayoutXml" IsDockable="True" Header="Layout Xml" /> <RadDocumentPane SerializationTag="DocumentPane" IsDockable="True" Title="Document 1" Header="Document 1" /> </Items> </RadPaneGroup> </Items> </RadSplitContainer> </DocumentHost> <SplitContainers> <RadSplitContainer Dock="DockedLeft" Width="240"> <Items> <RadPaneGroup SelectedIndex="0"> <Items> <RadPane SerializationTag="PaneLeft1" IsDockable="True" Header="Pane Left 1" /> <RadPane SerializationTag="PaneLeft2" IsDockable="True" Header="Pane Left 2" /> <RadPane SerializationTag="PaneLeft3" IsDockable="True" Header="Pane Left 3" /> <RadPane SerializationTag="PaneLeft4" IsDockable="True" Header="Pane Left 4" /> </Items> </RadPaneGroup> </Items> </RadSplitContainer> <RadSplitContainer Dock="DockedRight" Width="240"> <Items> <RadPaneGroup SelectedIndex="0"> <Items> <RadPane SerializationTag="PaneRight1" IsDockable="True" Header="Pane Right 1" /> </Items> </RadPaneGroup> </Items> </RadSplitContainer> <RadSplitContainer Dock="DockedTop" Height="180"> <Items> <RadPaneGroup SelectedIndex="0"> <Items> <RadPane SerializationTag="PaneTop1" IsDockable="True" Header="Pane Top 1" /> </Items> </RadPaneGroup> </Items> </RadSplitContainer> </SplitContainers> </RadDocking>
[Telerik]RadDocking第02篇 保存和加载RadDocking的布局
标签:
原文地址:http://blog.csdn.net/gjysk/article/details/42747917