Have a look at this example:
Dim oRow as DataGridViewRow = Nothing
For each oRow in Me.DataGridView1.Rows
If oRow.Index Mod 2 = 0 Then
oRow.DefaultCellStyle.Color = Color.Yellow
Else
oRow.DefaultCellStyle.Color = Color.Blue
End if
Next
The rest you need to do by yourself.