New window in a tabbed document window

2 posts, 0 answers
  1. Oguzhan
    Oguzhan avatar
    6 posts
    Member since:
    Dec 2010

    Posted 02 Nov 2014 Link to this post


    I've looked at the previous answers on this one such as however this doesn't do the trick for me. The goal is to design controls for a new document window and load that with details when the user double clicks on a list item to edit and view it in detail. When I try adding it as such:

                detailsForm _detailsForm = new detailsForm(listitem);
                _detailsForm.Dock = DockStyle.Fill;
                _detailsForm.TopMost = false;
                _detailsForm.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;

    I get the below exception:

    System.ArgumentException was unhandled by user code
      Message=Top-level control cannot be added to a control.
           at System.Windows.Forms.Control.ControlCollection.Add(Control value)

    Any ideas why?
  2. Dimitar
    Dimitar avatar
    2983 posts

    Posted 03 Nov 2014 Link to this post

    Hi Oguzhan,

    Thank you for writing.

    RadDock provides a method that allows you to directly dock the form and the document window will be automatically created for you: 
    private void radButton1_Click(object sender, EventArgs e)
        RadForm1 form = new RadForm1();
        form.BackColor = Color.Pink;
        form.Text = "My Form";
        this.radDock1.DockControl(form, DockPosition.Left, DockType.Document);

    Detailed information can be found here: Getting Started.

    Let me know if you have additional questions.

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

Back to Top