title: How to determine a DataGridViewRow from the DataRow it is bound to
body: <p>I would like to change the forecolor of a <code>DataGridViewRow</code> when a <code>DataTable</code> event is fired (specifically the <code>DataColumnChangeEvent</code>). In order to do so I need to get the associated <code>DataGridViewRow</code> of the row the event occurred on.</p>
  
  <p>I have the following:</p>
  
  <pre><code>private void DataColumnChanged(object sender, DataColumnChangeEventArgs e)
       {
       DataColumn col = e.Column;
       DataRow row = e.Row;
  
       if (col != null &amp;&amp; row != null)
          {
          if (col.ColumnName == "abc")
             {
             String str = col.ToString();
  
             if (str == "1")
                {
                DataGridViewRow dgvr = &lt;somehow get row's associated DataGridViewRow&gt; 
                ChangeRowForeColor(dgvr, "Purple");
                }
             }
          }
  </code></pre>
  
  <p>The following questions are the reverse direction (getting a <code>DataRow</code> from a <code>DataGridViewRow</code>), so I know that it can be found one way at least, but I can't seem to find info on the reverse problem.</p>
  
  <p><a href="https://stackoverflow.com/questions/1822314/how-do-i-get-a-datarow-from-a-row-in-a-datagridview">How do I get a DataRow from a row in a DataGridView</a></p>
  
  <p><a href="https://stackoverflow.com/questions/4014046/how-to-determine-which-datarow-is-bound-to-a-datagridviewrow">How to determine which DataRow is bound to a DataGridViewRow</a></p>
  
  <p>Example code of how to determine a <code>DataGridViewRow</code> from a <code>DataRow</code> would be greatly appreciated.</p>