How to make grid view colorful in c#
dataGridView1.EnableHeadersVisualStyles
= false;
dataGridView1.ColumnHeadersDefaultCellStyle.BackColor = Color.Beige;
dataGridView1.RowHeadersDefaultCellStyle.BackColor
= Color.Beige;
for (int i = 0; i < dataGridView1.Rows.Count; i++)
{
if (i % 2 != 0)
{
dataGridView1.Rows[i].DefaultCellStyle.BackColor = Color.Beige;
}
}
No comments:
Post a Comment