title: How to Use Textbox property Value in C#
body: <p>I have some problem in using textbox value that I get from <code>get set</code> accessors in C#. I have user control called <code>SerahTerima</code> that the textBox1 is shown to <code>Overview</code> form. After that, I want to show data to datagridview based on the textbox value that shown in <code>Overview</code> form but it's failed. How can I do ?</p>
  
  <p><img src="https://i.stack.imgur.com/vDaCf.jpg" alt="IMG1"></p>
  
  <p><strong>SerahTerima.cs</strong></p>
  
  <pre><code>private void button6_Click(object sender, EventArgs e)
          {
              Overview ov = new Overview();
              var textBoxContent = this.textBox7.Text;
              var parent = this.Parent as Overview;
              ov.ID2 = textBoxContent;
              ov.ShowDialog();
          }
  </code></pre>
  
  <p><strong>Overview.cs</strong></p>
  
  <pre><code>public string ID2
          {
                  set { textBox1.Text = value; }
              }
  
  private void TampilOverview()
          {
              OleDbDataAdapter adapter = new OleDbDataAdapter("SELECT * from alokasi_kunci", connection);
              DataTable dt = new DataTable();
              adapter.Fill(dt);
              connection.Open();
              dataGridView1.Rows.Clear();
  
              foreach (DataRow dr2 in dt.Rows)
              {
                  if (dr2["tim"].ToString() == textBox1.Text)
                  {
                      int aa = dataGridView1.Rows.Add();
  
                      dataGridView1.Rows[aa].Cells[0].Value = dr2["kelompok"].ToString();
                      dataGridView1.Rows[aa].Cells[2].Value = dr2["pic"].ToString();
                      dataGridView1.Rows[aa].Cells[3].Value = dr2["keterangan"].ToString();
                  }
  
              }
              connection.Close();
      }
  </code></pre>
  
  <p>When i run toogle breakpoint in textBox1, there is null value.</p>