سلام.
اين تابع يك ديتا گريد رو بعنوان پارامتر ميگيره و سطرهاي اونو يك در ميان رنگ آميزي ميكنه.
کد HTML:public void coloring_row(DataGridView dgv) { foreach (DataGridViewRow row in dgv.Rows) { if (row.Index % 2 == 0) { foreach (DataGridViewCell cell in dgv.Rows[row.Index].Cells) { dgv.Rows[row.Index].Cells[cell.ColumnIndex].Style.BackColor = Color.LightBlue; } } else { foreach (DataGridViewCell cell in dgv.Rows[row.Index].Cells) { dgv.Rows[row.Index].Cells[cell.ColumnIndex].Style.BackColor = Color.LightCyan; } } } }