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

Dynamicly create new Document and copy controls to it from existing tab

1 Answer 34 Views
Dock
This is a migrated thread and some comments may be shown as answers.
John Hamman
Top achievements
Rank 1
John Hamman asked on 26 Mar 2008, 03:08 PM
Hi all,
I want to the user to press a button and it will create a new DocumentPanel. The controls on that new tab will be the exact controls of the
DocumentPanel, plus I want to copy some content over from the old to the new. How do I create a new DocumentPanel dynamically with the same controls and layout of those controls of an existing DocumentPanel?
John

PS. I posted a simular question in the tabstrip forum, but I should have posted here.

1 Answer, 1 is accepted

Sort by
0
Julian Benkov
Telerik team
answered on 28 Mar 2008, 10:29 AM
Hi John,

Thank you for writing.

You can dynamically create a new DocumentPane with the code snippet below:

DocumentPane document = new DocumentPane();  
document.Text = "Document1";  
UserControl ctrl = new UserControl1();  
ctrl.Dock = DockStyle.Fill;  
document.Controls.Add(ctrl);  
this.dockingManager1.SetDocument(document); 

In order to copy the same content, you can make the UserControl and insert all controls with the desired layout, then create a DocumentPane with this UserControl.

I hope this helps. If you have additional questions, please contact me.

Regards,
Julian Benkov
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Dock
Asked by
John Hamman
Top achievements
Rank 1
Answers by
Julian Benkov
Telerik team
Share this question
or