title: Summing GridView column values
body: <p>I have a "time duration" column in a grid view, and I wish to sum that particular column in C# and publish the total time taken at a label named Total Time. How can I do this?</p>
  
  <p>Sample code:</p>
  
  <pre><code>int sum = 0;
  for (int i = 0; i &lt; dgTestSteps.SelectedColumns.Count; ++i)
  {
      sum += Convert.ToInt32(dgTestSteps.SelectedColumns.Count.ToString());
      //sum += Convert.ToInt32(dgTestSteps.Rows[i].Cells[1].Value);
  }
  lblTotalTime.Text = sum.ToString();
  </code></pre>