Monday, 6 April 2015

DataGridView changing cell background color

To change the cell background color in a Datagridview in a windows application we want to use the following
we have a datagridview with an Id of "dgvStatus".
First bind the datagridview while binding use the following code to change the cell backgroundcolor

//background color of cells

dgvStatus.DefaultCellStyle.BackColor = Color.FromArgb(255, 192, 128);

//dgvStatus.DefaultCellStyle.BackColor = Color.FromArgb(value of Red, value of Green, value of Blue);





Thanks Stackoverflow

No comments:

Post a Comment