Panes to ignore/omit on savelayout

4 posts, 0 answers
  1. Zack
    Zack avatar
    112 posts
    Member since:
    Jun 2012

    Posted 06 Feb 2012 Link to this post

    I have a docking system that has a few permanent and many dynamic possible panes or documentpanes. I set the serialization tags for the ones I want to be saved with the docking layout but I cannot seem to find a sure way to keep all other dynamic added panes from saving with the layout. Basically any items oftype radpane that do not have a serialization name I want to omit from the xml layout.

    I have a routine that iterates the documenthost.items and removes any that are not names with one of the known pane names I want to keep. But I notice when debugging the items only contains ones with serialization tags, and I can see that the DocumentHost.Panes has many, these are the ones I do not want to keep...

    (Called before saving docking layout)
    (holderMain is documentHost, panesToKeep is array of panes by name we know we want to keep with the saved layout)
    for(int p = 0; p<=holderMain.Items.Count; p++)
            RadPane pane = holderMain.Items[p] as RadPane;
            if (!panesToKeep.Contains(pane.Name)) pane.RemoveFromParent();
        catch { }

    But I still see in the saved xml that it contains various raddocumentpanes that have no serialization tags.
  2. Boyan
    Boyan avatar
    758 posts

    Posted 09 Feb 2012 Link to this post


    There is no way to exclude the some panes from being saved out of the box with the current implementation of RadDocking. We have this feature request logged in our PITS, you can vote for it and follow its progress here.

    I am not exactly understanding what is the problem which you are experiencing but will try to explain how it works. When you load the layout, all the elements that are not marked with SerializationTag property are removed and new components are created instead. That is the reason why you should mark your panes with the SerializationTag attribute. Then in order to exclude some panes from the Layout you can either manipulate the XML after saving the layout or use some of the events we have provided for Save/Load layout. The two events you can use are ElementSaving and ElementLoading where you can exclude panes according to a rule either before they are saved or before they are loaded. Another thing you can use is to remove the panes you don't want to save before actually saving the layout. For more info you can take a look at this help article.

    Don't hesitate to contact us if you have other questions.

    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
  3. Jesper
    Jesper avatar
    21 posts
    Member since:
    Oct 2012

    Posted 22 Jul 2013 Link to this post

    I have read your answer to this post but I can't what I exactly have to do in the ElementLoading or ElementSaving events in order to exclude a specific pane. In my case want to make sure that DocumentPanes are never saved/loaded.
  4. Rosen Vladimirov
    Rosen Vladimirov avatar
    640 posts

    Posted 25 Jul 2013 Link to this post

    Hello Jesper,

    Maybe you have noticed that the PITS item is marked as resolved - we have added ExcludeFromLayoutSave attached property, which you can set to true to your RadPanes that shouldn't be serialized. For example:
    <telerik:RadPane Header="Excluded Pane" telerik:RadDocking.SerializationTag="ExcludedPane" telerik:RadDocking.ExcludedFromLayoutSave="True"/>

    You can check this example in our SDK, which demonstrates how to save and load your layout.

    Hopefully this helps. Feel free to contact us in case you have any problems or concerns.

    Rosen Vladimirov
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
Back to Top