I am attempting to use SaveLayout and when our app is re-run I use LoadLayout. Unfortunately, if the user floats a pane and then exits the app (saving the layout), and later re-runs the app and I load the layout, the floating pane is no longer able to be docked.
Looking in the XML that's written I see the RadSplitContainer is written with InitialPosition="FloatingOnly" which seems suspicious. I tried manually updating the XML file to set InitialPosition="FloatingDockable" but the pane is still not dockable.
If it matters, I do have SerializationTag set for all my panes, splitters and panegroups and do override the ElementLoaded event to plug in my own children of each pane (that part is working great).
Does anyone know what I can change to make the reconstituted Pane dockable again?
9 Answers, 1 is accepted
1. When a pane is grabbed by mouse and manually un-docked, it can be re-docked (the desired effect). Later, when I use SaveLayout() , the RadSplitContainer in the floating tool window will write InitialPosition="FloatingOnly" which is blatantly wrong. This is surely a bug in RadDocking.
2. I have hacked a work-around which I'll share in hopes that somone has a better way.
First, I load the layout XML into memory using Linq to XML and "fix-up" the InitialPosition attribute value to be "FloatingDockable". I then feed this updated XML to LoadLayout(). This is vulnerable to a future change in the RadDocking XML.
This was not sufficient to fix the problem as the RadPane is also sometimes marked with IsDockable="False" in the XML produced by SaveLayout. I never set this attr in code and have the ContextMenuTemplate = null (so users cannot uncheck 'Dockable') so this appears to be another bug in the docking framework. I repair this for all panes handled in the ElementLoaded event by calling pane.MakeDockable();
I would love to be proven wrong in something I'm doing.
Thank you for contacting us.
We are not aware of such issue with RadDocking. I tried to reproduce your scenario in our online examples, but to no avail. Attached you can find the demo I made for you. Please let me know if I did something wrong.
Looking forward to your reply.All the best,
the Telerik team
Unfortunately, I don't see an attachment on your message or on the thread.
But..it's currently very close to our main app and is working!! So that's good...but also tricky b/c the difference must be attributable to something small. ex. the test has a textbox in each pane but our main app has other controls, of course.
Another difference from other samples I've looked at is that in our main app, I need to populate the RadDocking control in code (C++/CLI) and not XAML but my sample is C# so I may be overlooking something small in the differences. Will keep investigating...
Sorry for this misunderstanding. Here is the attachment.
I hope it helps! I will be glad to assist you further.
the Telerik team
Thanks again for your example!
This is the heart of the code I ended up using as a workaround. Sorry it's C++ but it should be easy to convert if you need C#.