Programmatic Add/Removal of RadPane along with Save/Load layout

3 posts, 0 answers
  1. David
    David avatar
    9 posts
    Member since:
    Oct 2010

    Posted 08 Jun 2011 Link to this post

    We have a project where users can add/remove RadPanes to a RadDocking control, which contain controls, etc.  The users can also save their layout and then load it back when they next run the silverlight app.

    I have two questions:

    1)  I'm using the "Close" event on the RadDocking control to capture when the user wants to remove a RadPane from the docking control, then I iterate through the panes, find each "hidden" pane and remove it from it's parent.  I also check to see if the parent group control contains any other panes and remove it as well.

    My problem is that when saving the layout, the XML string still contains things about the removed group and the split container (pane does seem to be removed though).  Is this the correct direction to remove a RadPane, or is there a better way which I'm missing? (I'm concerned this will grow and grow with unwanted XML markup and bulk down the loading process).

    Sorry to make this long, but seems to talk about this issue beign fixed, but I'm still having the same problem with 2011 Q1 control.

    2) The second question is about adding/loading panes.  Adding a RadPane is easy and I use the Spliter/Group/Pane controls for this, but when loading the XML layout, I first programmatically create each RadPane in the docking control then load the XML layout which repositions everything.  This does work, but I feel it's a bit clunky and I'm not really happy with doing it this way.  Is there a better way?  (I did think about loading the panes in a hidden state, loading the XML, then iterate through and show them too, which might be better)

    Thanks so much in advance...  David
  2. Miroslav Nedyalkov
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 09 Jun 2011 Link to this post

    Hello David,

     1. It would be easier to remove the panes once they are closed using the RemoveFromParent method and the Close and PreviewClose events. When you remove all the panes from a group that is auto-generated (it was generated because of user interaction) it is automatically disposed and not save to the XML.

    The problem reported in the forum thread is fixed - we not delete the empty auto-generated groups. The problem was that after layout load we didn't know which were auto-generated in the previous session. This problem shouldn't happen anymore.

    2. The dynamically created panes should be loaded using the ElementLoading and ElementLoaded events of the Docking control.

    Hope this information helps.

    All the best,
    Miroslav Nedyalkov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. DevCraft R3 2016 release webinar banner
  4. David
    David avatar
    9 posts
    Member since:
    Oct 2010

    Posted 09 Jun 2011 Link to this post

    Thanks for that, I decided to use the ElementLoaded event to add the contents which works well.
Back to Top