Having a Layout Serialized programmatically

2 posts, 1 answers
  1. Nathan J Pledger
    Nathan J Pledger avatar
    95 posts
    Member since:
    Apr 2006

    Posted 28 Aug 2009 Link to this post


    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); 
                    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);                                

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

  2. Answer
    Miroslav Nedyalkov
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 31 Aug 2009 Link to this post

    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.

    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.
Back to Top