Change Color of Alternate Rows in the DataGridView
Change Color of Alternate Rows in the DataGridView
C#
private void btnAlternate_Click(object sender, EventArgs e)
{
this.dgv.RowsDefaultCellStyle.BackColor = Color.White;
this.dgv.AlternatingRowsDefaultCellStyle.BackColor = Color.Aquamarine;
}
VB.NET
Private Sub btnAlternate_Click(ByVal sender As Object, ByVal e As EventArgs)
Me.dgv.RowsDefaultCellStyle.BackColor = Color.White
Me.dgv.AlternatingRowsDefaultCellStyle.BackColor = Color.Aquamarine
End Sub
Thanks code is helpful