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

Having a Layout Serialized programmatically

1 Answer 126 Views
Docking
This is a migrated thread and some comments may be shown as answers.
Nathan J Pledger
Top achievements
Rank 2
Nathan J Pledger asked on 28 Aug 2009, 03:10 PM
Hi,

I'm using the example here:


(By the way, your documentation is unfinished and needs some polish. I also couldn't get the CHM in the latest version to work again)

I want to be able to allow users to load/save layouts.My difference is that I am creating the panels programmatically. An excerpt of my code is below:

    switch (paneType) 
            { 
                case PaneType.Document:                  
                    RadDocumentPane documentPane = new RadDocumentPane(); 
                    documentPane.Header = name; 
                    documentPane.Title = name;                   
                    //DocumentHost documentHost = (DocumentHost)_radDocking.DocumentHost;                                        
                    RadSplitContainer splitContainer = (RadSplitContainer)_radDocking.DocumentHost; 
                    RadPaneGroup documentPaneGroup = (RadPaneGroup)splitContainer.Items[0]; 
                    documentPaneGroup.AddItem(documentPane, DockPosition.Center); 
                    break
                case PaneType.Explorer: 
                case PaneType.Explorer | PaneType.Document: 
                    // default to left 
                    RadPane pane = new RadPane(); 
                    pane.Header = name; 
                    pane.Title = name;                   
                    pane.Content = new TextBlock() { Text = "Hello from " + name }; 
                    foreach (RadSplitContainer dockedSplitContainer in _radDocking.Items) 
                    { 
                        switch (dockedSplitContainer.SplitterPosition) 
                        { 
                            case Dock.Right: 
                                RadPaneGroup paneGroup = (RadPaneGroup)dockedSplitContainer.Items[0]; 
                                paneGroup.AddItem(pane, DockPosition.Center);                                
                                break
                        } 
                    } 
 
         
                    break
 
            } 


How do I set the SerializationTags to permit the reliableserialisation of the layout?

1 Answer, 1 is accepted

Sort by
0
Accepted
Miroslav Nedyalkov
Telerik team
answered on 31 Aug 2009, 10:14 AM
Hi Nathan,

You can do this by using the following code:
RadDocking.SetSerializationTag(pane, "some serialization tag"); 

You can use the same approach for all attached properties you would like to set in the code.

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.
Tags
Docking
Asked by
Nathan J Pledger
Top achievements
Rank 2
Answers by
Miroslav Nedyalkov
Telerik team
Share this question
or