title: Create thread within datagridview loop and retain the row
body: <p>I am trying to loop through a datagridview and create a new task for each row (to do work on each row simultaneously). If using my current method will it lose the row?</p>
  <p>Example: If I had 1000 rows in a datagridview, created a task for each during a loop, then updated parts of the row during the task do I need to somehow pass the row index to the new task instead of below?</p>
  <p>For Example:</p>
  <pre><code>foreach (DataGridViewRow locaterow in Form1.form.MainGrid.Rows) //loop through maingrid
                  {
                          new Thread(() =&gt;
                          {
                             locaterow.Cells[&quot;Mainvalue&quot;].Value = Convert.ToInt32(locaterow.Cells[&quot;Mainvalue&quot;].Value) + 1;
                           }).Start();
                   }
  </code></pre>
  <p>Will the thread be updating the datagridview row the thread was started on? If not, how can I pass the row index to the new thread to use that after its created?</p>