title: Alternate background color every 2 rows
body: <p>I want to alternate the background color every 2 rows.</p>
  
  <p>Example:</p>
  
  <p><a href="https://i.stack.imgur.com/n64ox.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/n64ox.jpg" alt="enter image description here"></a></p>
  
  <p>What I get:</p>
  
  <p><a href="https://i.stack.imgur.com/adrJr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/adrJr.png" alt="Alternate"></a></p>
  
  <p>I use this code but it doesn't work correctly, as you can see in the image above.</p>
  
  <pre><code>Dim contador As Integer
  'Adding DataRow
  For Each row As DataGridViewRow In dataCasados.Rows
      If contador Mod 2 = 0 Then
          pdfTable.DefaultCell.BackgroundColor = Color.RED
      Else
          pdfTable.DefaultCell.BackgroundColor = Color.BLUE
      End If
  
      For Each cell As DataGridViewCell In row.Cells
          pdfTable.AddCell(cell.Value.ToString())
      Next
  
      contador += 1
  
  Next
  </code></pre>
  
  <p>Any help pls?</p>