Changing datagridview cell color dynamically

后端 未结 5 539
伪装坚强ぢ
伪装坚强ぢ 2020-11-29 11:04

I have a dataGridView object that is populated with data. I want to click a button and have it change the color of the background of the cell. This is what I currently have<

5条回答
  •  攒了一身酷
    2020-11-29 11:42

    This works for me

    dataGridView1.Rows[rowIndex].Cells[columnIndex].Style.BackColor = Color.Red;
    

提交回复
热议问题