Hi Richard,
From my experience, we can only set the color of the cells in a row or a column. This is the code snippet:
//Set the backcolor of the cells in the first row.
dataGridView1.Rows[0].DefaultCellStyle.BackColor = Color.Red;
//Set the backcolor of the cells in the first column.
dataGridView1.Columns[0].DefaultCellStyle.BackColor = Color.Red;
Based on my understanding, you did set the backcolor of one column and want to set the backcolor of one cell to another cell in the same row. You can follow the code snippet below:
//Set the backcolor of column 2 to the backcolor of column 1.
dataGridView1.Columns[2].DefaultCellStyle.BackColor = dataGridView1.Columns[1].DefaultCellStyle.BackColor;
We can also handle the CellPainting event to redraw the background of one cell to change the backcolor of only one cell. Did you set the color of one cell in this way?
Regards,
Aland Li
Please mark the replies as answers if they help and unmark if they don't. This can be beneficial to other community members reading the thread.