Saving contents of RadPane

4 posts, 0 answers
  1. Mike5
    Mike5 avatar
    7 posts
    Member since:
    Nov 2011

    Posted 31 Jan 2012 Link to this post

    My WPF application permits users to select from a collection of <UserControl/> at runtime.
    Each <UserControl/> is loaded as content to a RadPane. Each RadPane, RadPaneGroup
    and RadSplitContainer has a unique serialization tag:

    internal void UserControlToRADPane(UserControl theControl, string theName)
        RadSplitContainer leftContainer = new RadSplitContainer() { InitialPosition = DockState.DockedLeft };
        RadPaneGroup group = new RadPaneGroup() { Name = "RPG" + (++_radPaneGroupId).ToString() };
        RadPane aPane = new RadPane() { Header = theName, Content = theControl };
        RadDocking.SetSerializationTag(leftContainer, "rsp_" + leftContainer.Name + "_tag" + (++_aStaticIntValue).ToString());
        RadDocking.SetSerializationTag(group, "rpg_" + group.Name + "_tag" + (++_aStaticIntValue).ToString());
        RadDocking.SetSerializationTag(aPane, "rp_" + aPane.Header + "_tag" + (++_aStaticIntValue).ToString());
        group.AddItem(aPane, DockPosition.Center);

    I have created an event handler for ElementSaving.  At the point we are saving a RadPane, I
    want to serialize the contents (which is a user-selected <UserControl/> as above):

    private void dockingManager01_ElementSaving(object sender, LayoutSerializationEventArgs args)
        // Since we are accessing UI elements, we need ownership and
        // the quickest way to get that is to run on the STA thread.
        if (args.AffectedElement.GetType() == typeof(Telerik.Windows.Controls.RadPane))
            var uc = ((RadPane)args.AffectedElement).Content as UserControl;
            ViewModel.VMDockingManager01.Instance.ElementSaving(sender, args, uc);
            ViewModel.VMDockingManager01.Instance.ElementSaving(sender, args);

    My first question: Am I on the right track with this approach, or has Telerik implemented
    some functionality that would permit a cleaner approach?   I note a reference to a method
    called GetPaneContent() at this link in the Silverlight forum.  Is that a reference to some
    user-created method... or is it a method provided by Telerik?

  2. George
    George avatar
    1332 posts

    Posted 03 Feb 2012 Link to this post

    Hello Mike,

    You are on the right approach. The GetPaneContent() method is a user-defined method and its implementation is different in all scenarios and this is the reason why its body is not included in our documentation.

    Please, do not hesitate to contact us if you have further questions.


    Kind regards,
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  3. A
    A avatar
    2 posts
    Member since:
    Feb 2019

    Posted 04 Feb 2019 in reply to George Link to this post


    Can you please tell me how do i save contents of my radpane which are created dynamically. The header of radpane has a button which does not get saved when i save the layout.


  4. Kalin
    Kalin avatar
    1360 posts

    Posted 06 Feb 2019 Link to this post


    Could you please open up a support ticket and share a sample project demonstrating the exact RadDocking setup? After checking it on our side we would be glad to suggest the best possible solution for the concrete scenario.

    If you have any other questions, let me know.

    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Back to Top