I'm trying to persist layout data in userprofle and then reloading the layout.
When I'm reloading layout I'm observing that "name" or "tag" or even other internal property for properly identification
at loading time doesn't serialize properly (They have empty value). I need an id property to be serialized to be able to restore the layout properly at deserialize (matching panel content hosting of dockingPanel layout with the proper UIElemets)
Sample code:
//Saving:
using (MemoryStream stream = new MemoryStream())
{
foreach (RadPane pane in dockPanelMgr.Panes)
{
//I'm trying set-up Tag property for serialization if
pane.Tag = pane.Name;
}
dockPanelMgr.SaveLayout(stream);
ServiceProvider.Get<Settings>()
.Layout.LayoutSerialization =
UTF8Encoding.UTF8.GetString(stream.GetBuffer());
}
ServiceProvider.Get<Settings>().Save();
//Loading:
string layout = ServiceProvider.Get<Settings>().Layout.LayoutSerialization;
using (MemoryStream ms = new MemoryStream(UTF8Encoding.UTF8.GetBytes(layout)))
{
dockPanelMgr.LoadLayout(ms);
}
8 Answers, 1 is accepted
Do you set the RadDocking.SerializationTag attached property to the controls you would like to identify after that? If yes, you could use its value as ID. If you don't set it you should keep in mind that the Docking control is using this attached property to identify the elements.
Unfortunately as you correctly noticed the Docking control doesn't serialize the Name and Tag properties. It doesn't serialize the Name property to prevent eventual name conflicts and cannot serialize the Tag property as it is of type Object and the Docking control doesn't know how to serialize objects of type Object.
Regards,Miroslav Nedyalkov
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.

First of all thank you for your promptitude.
If I made a simple task: SaveLayout of RadDocking and then LoadLayout again I'll have an empty RadDocking (All existing business Controls linked on old layout wouldn't be linked again for new layout). So I have to relinked it again.
Tag can be involved in serialization property accepted by RadDocking because xmlSerializer automatically serialize based type (string, int or what ever). I'm made sure that assigned property for tag is string type.
I have below an xml sample obtained by serialization of your dockingControl. I cannot to identify the host where can I linked my control based on Header or Title property for panel . The serialization issue exists only to restore the desired user layout linked on business controls. How can I do that?
I can see in your XML that you didn't set the RadDocking.SerializationTag property to any of the items in the docking control (it would be serialized in other case). If you set it to all of the panes, the Docking control will take care of the relinking the controls in the panes (it accomplishes the task correctly in most of the cases). Please, refer to the following article that demonstrates how to use the serialization of the Docking control - http://blogs.telerik.com/miroslavnedyalkov/posts/09-04-22/raddocking_save_load_layout.aspx
Best wishes,Miroslav Nedyalkov
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.

It's worked! I've inspect deeply radDocking properties.
..............
<telerikDocking:RadPaneGroup>
<telerikDocking:RadDocumentPane
CanFloat="False" CanUserClose="False" Name="dpImageViewer"
telerik:RadDocking.SerializationTag="dpImageViewer">
..............

Am I missing something?
You don't need to set this property to true - this is its default value. The panes can became non-dockable only if they are FloatingOnly which can be achieved by calling the MakeFloatingOnly method of the pane or by setting the InitialPosition of its SplitContainer to FloatingOnly.
Hope this information is helpful.
Regards,
Miroslav Nedyalkov
the Telerik team

Thanks
It's good to hear that you found what you were looking for.
Kind regards,Miroslav Nedyalkov
the Telerik team