title: how to get sum dynamically of datagridview column in textbox
body: <p>I want to get the sum of a column of datagridview and show that in textbox. After each entry the sum should be changed dynamically. For that I am using textChanged event of a textbox but when the entry is made it does not show any result. I want to get the result dynamically in the textbox. I want to avoid the use of button for sum.</p>
  
  <p>Here is a piece of code for the textbox textChanged event:</p>
  
  <pre><code>private void textBox9_TextChanged(object sender, EventArgs e)
          {
              double sum = 0;
              for (int i = 0; i &lt; dataGridView2.Rows.Count; ++i)
              {
                  sum += Convert.ToDouble(dataGridView2.Rows[i].Cells[5].Value);
              }
              textBox9.Text = sum.ToString();
          }
  </code></pre>