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

2 posts, 0 answers
  1. John Hamman
    John Hamman avatar
    10 posts
    Member since:
    Feb 2006

    Posted 26 Mar 2008 Link to this post

    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?

    PS. I posted a simular question in the tabstrip forum, but I should have posted here.
  2. Julian Benkov
    Julian Benkov avatar
    1135 posts

    Posted 28 Mar 2008 Link to this post

    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;  

    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.

    Julian Benkov
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. DevCraft R3 2016 release webinar banner
Back to Top