title: Multiple DataGridViews on 1 Form
body: <p>I have a simple form that displays a DataGridView; and I would like to display a second DataGridView object below the first on the same form.</p>
  
  <p>But when i run the code, it only displays the first. When running through the debugger, the form lists that it has both datagridviews linked to it.</p>
  
  <pre><code>System.Windows.Forms.Form form
            = new System.Windows.Forms.Form();
          form.Size = new System.Drawing.Size(450, 400);
          form.Text = "Form";
  
          DataGridView dg = new DataGridView();
          dg.AllowUserToAddRows = false;
          dg.AllowUserToDeleteRows = false;
          dg.AllowUserToOrderColumns = true;
          dg.Dock = System.Windows.Forms.DockStyle.Fill;
          dg.Location = new System.Drawing.Point(0, 0);
          dg.ReadOnly = true;
          dg.TabIndex = 0;
          dg.DataSource = dt;
          dg.Parent = form;
  
  
  
          DataGridView dgHangers = new DataGridView();
          dgHangers.AllowUserToAddRows = false;
          dgHangers.AllowUserToDeleteRows = false;
          dgHangers.AllowUserToOrderColumns = true;
          dgHangers.Dock = System.Windows.Forms.DockStyle.Fill;
  // attempting get the bottom of the first DataGridView() so the second will display below.
          dgHangers.Location = new System.Drawing.Point(0, dg.DisplayRectangle.Bottom);
          dgHangers.ReadOnly = true;
          dgHangers.TabIndex = 1;
          dgHangers.DataSource = hangerTable;
          dgHangers.Parent = form;
  
  
  
          form.ShowDialog();
  </code></pre>
  
  <p>Form :</p>
  
  <p><img src="https://i.stack.imgur.com/sfQJP.png"/></p>