title: Adding data to a gridview in c# from multiple forms
body: <p>How would I go about inserting the text that I have entered in to the textbox in NewActivity into the first column in the datagridview on form1?</p>
  
  <p>Here is the coding I have thus far.</p>
  
  <p>Form1 </p>
  
  <pre><code>    public partial class Form1 : Form
      {
          public Form1()
          {
              InitializeComponent();
              this.IsMdiContainer = true;
          }
  
          private void viewToolStripMenuItem1_Click(object sender, EventArgs e)
          {
          }
  
          private void newActivityToolStripMenuItem_Click(object sender, EventArgs e)
          {
              NewActivity NewAc = new NewActivity();
              NewAc.MdiParent = this;
              NewAc.Show();
          }
  
          private void deleteActivityToolStripMenuItem_Click(object sender, EventArgs e)
          {
          }
      }
  }
  </code></pre>
  
  <p>NewActivity</p>
  
  <pre><code> public partial class NewActivity : Form
      {
          public string activityName;
  
          public NewActivity()
          {
              InitializeComponent();
          }
  
          private void btnCancel_Click(object sender, EventArgs e)
          {
              activityName = "";
              this.Close(); 
          }
  
          private void btnAddActivity_Click(object sender, EventArgs e)
          {
              activityName = txtActivityName.Text;            
              this.Close();           
          }             
      }
  }
  </code></pre>