title: DataGridView CellFormatting not formatting all specified cells
body: <p>I have an SQL query that populates a DataGridView through a DataTable:</p>
  
  <pre><code>SELECT top 100 a.Ordnum, oldBFE, newBFE, oldCBRA, newCBRA, oldLOMC, newLOMC, oldfld,    newfld FROM 
  (SELECT Ordnum, PrpBFE as oldBFE, CBRADte as oldCBRA, LOMCDte as oldLOMC, FldZne AS oldfld 
  FROM [TOD].[dbo].[Orders] with (NOLOCK) WHERE RecRevDesc = '1 - Order Clone') a 
  JOIN 
  (SELECT Ordnum, PrpBFE as newBFE CBRADte as newCBRA, LOMCDte as newLOMC, FldZne AS newfld 
  FROM [TOD].[dbo].[Orders] with (NOLOCK) WHERE RecRevDesc = '2 Determination Completed-Workflow') b 
  ON a.Ordnum = b.Ordnum
  </code></pre>
  
  <p>If the value of certain pairs of cells are not equal, I need both cells to have a red forecolor. Right now, I am firing this through the cellformatting event:</p>
  
  <pre><code>For i As Integer = 0 To Me.gridCompare.RowCount - 1
    If Me.gridCompare.Rows(i).Cells(1).ToString &lt;&gt; Me.gridCompare.Rows(i).Cells(2).ToString Then
      Me.gridCompare.Rows(i).Cells(1).Style.ForeColor = Color.Red
      Me.gridCompare.Rows(i).Cells(2).Style.ForeColor = Color.Red
    ElseIf Me.gridCompare.Rows(i).Cells(3).ToString &lt;&gt; Me.gridCompare.Rows(i).Cells(4).ToString Then
      Me.gridCompare.Rows(i).Cells(3).Style.ForeColor = Color.Red
      Me.gridCompare.Rows(i).Cells(4).Style.ForeColor = Color.Red
    ElseIf Me.gridCompare.Rows(i).Cells(5).ToString &lt;&gt; Me.gridCompare.Rows(i).Cells(6).ToString Then
      Me.gridCompare.Rows(i).Cells(5).Style.ForeColor = Color.Red
      Me.gridCompare.Rows(i).Cells(6).Style.ForeColor = Color.Red
    ElseIf Me.gridCompare.Rows(i).Cells(7).ToString &lt;&gt; Me.gridCompare.Rows(i).Cells(8).ToString Then
      Me.gridCompare.Rows(i).Cells(7).Style.ForeColor = Color.Red
      Me.gridCompare.Rows(i).Cells(8).Style.ForeColor = Color.Red
    End If
  Next
  </code></pre>
  
  <p>However, only cells 1 and 2 have the correct formatting. What am I doing wrong? The order of the columns does not matter. I have tried individual IF statements as well.</p>