Changing datagridview cell color dynamically

后端 未结 5 567
伪装坚强ぢ
伪装坚强ぢ 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:46

    If you want every cell in the grid to have the same background color, you can just do this:

    dataGridView1.DefaultCellStyle.BackColor = Color.Green;
    

提交回复
热议问题