I have searched high and low for an answer to this question.The answer on this post: Change Color of Button in DataGridView Cell does not answer my question as it regards font.
I have tried the following:
DataGridViewRow r = dataGridView.Rows[0];
r.Cells[1].Style.BackColor = Color.Red;
I have also tried:
DataGridViewButtonColumn btnCOl = new DataGridViewButtonColumn();
btnCOl.FlatStyle = FlatStyle.Popup;
DataGridViewRow r = dataGridView.Rows[0];
r.Cells[1].Style = new DataGridViewCellStyle { BackColor = Color.LightBlue };
Still to no avail.
I also commented out this line:
// Application.EnableVisualStyles();
If there is anyone who knows how to change the background color of a single button in a DataGridViewButtonColumn, please help.
EDIT: I want to set different colors for the cells in the column e.g. some will be red while others will be green. I don't want to set the color for the whole column.