title: Datagridview: How to change color of alternate rows having cell value alternate days?
body: <p>Respected Sir,
  I have  a datagridview filled with data having various timestamps in one column</p>
  
  <p><img src="https://i.stack.imgur.com/1sssM.jpg" alt="enter image description here"></p>
  
  <p>And trying to colour rows in range of alternate days like the image above. So far, i am trying like this</p>
  
  <pre><code>Private Sub alternateDaysRows()
          For i As Integer = 1 To Me.datagridview1.Rows.Count - 1
              If i &gt; 1 Then
                  Dim myLastRowDate As Date
                  myLastRowDate = CType(Me.datagridview1.Rows(Me.datagridview1.Rows.Count - 1).Cells(2).Value, DateTime).Date
                  myCountDate = myLastRowDate.AddDays(1)
                  For Each row As DataGridViewRow In Me.datagridview1.Rows
                      If CType(row.Cells(2).Value, DateTime).Date = myCountDate Then
                          row.DefaultCellStyle.BackColor = Color.WhiteSmoke
                      End If
                  Next
              End If
          Next
      End Sub
  </code></pre>
  
  <p>any suggestions ?</p>
  
  <p>yours faithfully
  Murulimadhav</p>