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

LoadLayout RadDocumentPane

1 Answer 46 Views
Docking
This is a migrated thread and some comments may be shown as answers.
Wang
Top achievements
Rank 1
Wang asked on 20 Oct 2016, 09:46 AM

Hello!

I have a issue about show conent of RadDocumentPane when LoadLayout.

in my project,I LoadLayout of a docking from xml file,the Layout can be loaded right,

the conent in other  RadPane can be shown right,but content in RadDocumentPane can not show.

this is my code:

<telerik:RadDocking x:Name="MainDocking">
            <telerik:RadDocking.DocumentHost >
                <telerik:RadSplitContainer>
                    <telerik:RadSplitContainer InitialPosition="DockedLeft" Orientation="Vertical">
                        <telerik:RadPaneGroup>
                            <telerik:RadPane Header="a1" telerik:RadDocking.SerializationTag="a2" CanUserClose="False">
                                <TextBlock Text="CanShow" />
                            </telerik:RadPane>
                        </telerik:RadPaneGroup>
                    </telerik:RadSplitContainer>
                    <telerik:RadSplitContainer>
                        <telerik:RadPaneGroup>
                            <telerik:RadDocumentPane x:Name="documentPane" CanUserClose="False" Title="Robot" Header="Robot">
                                <TextBlock Text="CanNotShow" />
                            </telerik:RadDocumentPane>
                        </telerik:RadPaneGroup>
                    </telerik:RadSplitContainer>
                </telerik:RadSplitContainer>
            </telerik:RadDocking.DocumentHost>
</telerik:RadDocking>

 

back code:

private MainWindow()
        {
            InitializeComponent();
            LoadLayout();
        }
        public void LoadLayout()
        {
            var path = Path.Combine(vm.rootPath, "1.xml");
            using (var fileStream = File.Open(path, FileMode.Open, FileAccess.Read))
            {
                var reader = new StreamReader(fileStream);
                var serializationString = reader.ReadToEnd();
                LoadLayoutFromString(serializationString);
            }
        }

        private void LoadLayoutFromString(string xml)
        {
            using (Stream stream = new MemoryStream(Encoding.UTF8.GetBytes(xml)))
            {
                stream.Seek(0, SeekOrigin.Begin);
                this.MainDocking.LoadLayout(stream);
            }
        }

 

what should I do?

1 Answer, 1 is accepted

Sort by
0
Wang
Top achievements
Rank 1
answered on 20 Oct 2016, 10:04 AM

I found the solution, I missed SerializationTag

^-^

Tags
Docking
Asked by
Wang
Top achievements
Rank 1
Answers by
Wang
Top achievements
Rank 1
Share this question
or