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

New RadPane not displayed when using serialized layout

8 Answers 163 Views
Docking
This is a migrated thread and some comments may be shown as answers.
Charlie
Top achievements
Rank 2
Charlie asked on 17 Dec 2010, 05:52 PM
We are building an application that uses the MVVM pattern and Prism.
Our application utilizes Rad Docking Serialization.
The application has a DocumentHost with several tabbed Panes.  When a new Pane is added to the application inside the DocumentHost, it's not initially displayed after the docking serialization is read in.  But we hook a toggle button up to each pane to control visibility and clicking the button brings the new pane into view.
Here's the problem.
When we add a new Pane outside of the DocumentHost, the trick above doesn't work.  The pane will not be seen unless the serialization is deleted.

I found mention of using LayoutSerializationLoadingEventArgs but could not find an example.
Is there an event I can catch to add the new pane to the serialization?
Or should this just work, and there's something wrong with my implementation?
Thanks

8 Answers, 1 is accepted

Sort by
0
George
Telerik team
answered on 23 Dec 2010, 01:05 PM
Hi Charlie,

The ElementLoading event is raised when a docking element (PanePaneGroup or SplitContainer) is about to be loaded. You could refer to our online documentation - http://www.telerik.com/help/wpf/raddocking-save-load-the-content-of-the-panes.html. The RadDocking cannot save the Content of the panes itself. You need to set the Content of each pane manually in the ElementLoading event handler if these panes are generated in runtime.

Please do not hesitate to contact us if you require any further information.



Kind regards,
George
the Telerik team
Browse the videos here>> to help you get started with RadControls for WPF
0
Charlie
Top achievements
Rank 2
answered on 27 Dec 2010, 09:04 PM
George - thank you for replying.
My problem is not that I am trying to restore the contents of a pane, but the actual visibility of a NEW pane.

Let me describe another way.  Our users have had the application for several months.  They get a new version of the application that has a new feature - a pane that shows a list of report configurations they can run.
However, they won't see that new pane - maybe because it wasn't in their serialization file.
We bind the "IsHidden" property of the new pane to the state of a toggle button.  But toggling that button does not bring the new pane into view.
If we delete the docking serialization file, the new pane is shown (and the toggle button works).
0
George
Telerik team
answered on 03 Jan 2011, 05:08 PM
Hi Charlie,

 
This shed some light on the problem. I would suggest you to add the new RadPane in the code behind after the RadDocking.LoadLayout() method is called. In this way, you will ensure that the new RadPane will not be overriden from the old xml. 

All the best,
George
the Telerik team
Browse the videos here>> to help you get started with RadControls for WPF
0
lee hom
Top achievements
Rank 1
answered on 30 Mar 2011, 08:47 PM
I have the same problem:
First,I called Docking.LoadLayout() method to load layout.
Second,I use code to add a new RadPane to the Docking,
RadPane rp = new RadPane();
           rp.Header = fi.Code + " " + fi.CycleName;
           rp.Title = rp.Header;
           rp.Tag = fi.Key;
           rp.IsHidden = false;
           fi.IsShow = true;
           RadDocking.SetSerializationTag(rp, fi.Key);
           this.GroupDocument.AddItem(rp, Telerik.Windows.Controls.Docking.DockPosition.Center);
but, the new radpane is not visbility.
0
George
Telerik team
answered on 31 Mar 2011, 12:50 PM
Hi,

 
I would suggest you to use the RadPaneGroup.Items.Add method, not the RadPaneGroup.AddItem.

Please, let me know if this helps.


Best wishes,
George
the Telerik team
0
lee hom
Top achievements
Rank 1
answered on 31 Mar 2011, 01:50 PM

Thank you,but it dosn't work. here is the code

        private void radButton1_Click(object sender, RoutedEventArgs e)
        {
            RadPane rp = new RadPane();
            rp.Header = DateTime.Now.ToString("yyyyMMddHHmmssfff");
            rp.Title = rp.Header;

            RadDocking.SetSerializationTag(rp, rp.Header.ToString());
            this.GroupDocument.Items.Add(rp);
        }

0
lee hom
Top achievements
Rank 1
answered on 03 Apr 2011, 03:16 PM

            using (Stream stream = new MemoryStream(Encoding.UTF8.GetBytes(xml)))
            {
                stream.Seek(0, SeekOrigin.Begin);
                this.Docking.LoadLayout(stream);
            }

            RadPane rp = new RadPane();
            rp.Header = DateTime.Now.ToString("yyyyMMddHHmmssfff");
            rp.Title = rp.Header;
            RadDocking.SetSerializationTag(rp, rp.Header.ToString());
            ((Telerik.Windows.Controls.RadPaneGroup)((Telerik.Windows.Controls.RadSplitContainer)Docking.DocumentHost).Items[0]).Items.Add(rp);    //need like this.....

            Thank you
0
George
Telerik team
answered on 06 Apr 2011, 08:37 AM
Hello,


When the layout is loaded, the reference to that RadPaneGroup is changed. I would suggest you to add a SerializationTag to this group as well. This will resolve the problem.

 
All the best,
George
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Docking
Asked by
Charlie
Top achievements
Rank 2
Answers by
George
Telerik team
Charlie
Top achievements
Rank 2
lee hom
Top achievements
Rank 1
Share this question
or