Reputation: 33
I have a datagridview where every two rows are part of a pair and I would like to keep paired rows the same color for easier reading.
How can I do this when adding new rows programmatically? Thanks
Upvotes: 0
Views: 63
Reputation: 1019
You need to add attributes to your datagridview tag.
this.dataGridView.RowsDefaultCellStyle.BackColor = Color.Black;
this.dataGridView.AlternatingRowsDefaultCellStyle.BackColor = Color.Yellow;
Upvotes: 0