13-09-18, 01:37 AM
استخدم الحدث RowPrePaint للداتاجريد
كود :
private void dataGridView1_RowPrePaint(object sender, DataGridViewRowPrePaintEventArgs e) {
if (e.RowIndex % 4 == 0 || e.RowIndex % 4 == 1) {
dataGridView1.Rows[e.RowIndex].DefaultCellStyle.BackColor = Color.White;
}
else {
dataGridView1.Rows[e.RowIndex].DefaultCellStyle.BackColor = Color.LightGray;
}
}