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

Saving contents of RadPane

3 Answers 73 Views
Docking
This is a migrated thread and some comments may be shown as answers.
Mike5
Top achievements
Rank 1
Mike5 asked on 31 Jan 2012, 09:13 PM
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);
    leftContainer.Items.Add(group);
    MainDockingManager01.Items.Add(leftContainer);
}


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);
    }
    else
        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?




3 Answers, 1 is accepted

Sort by
0
George
Telerik team
answered on 03 Feb 2012, 03:28 PM
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,
George
the Telerik team

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

0
A
Top achievements
Rank 1
answered on 04 Feb 2019, 08:57 AM

Hii

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.

 

0
Kalin
Telerik team
answered on 06 Feb 2019, 02:51 PM
Hi,

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.

Regards,
Kalin
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.
Tags
Docking
Asked by
Mike5
Top achievements
Rank 1
Answers by
George
Telerik team
A
Top achievements
Rank 1
Kalin
Telerik team
Share this question
or