Assign a rgb color to a cell in a datagridview

3
row.Cells(0).Style.BackColor = Color.Red 'RGB(1, 1, 1)

The RGB does not accept it. How would you do in this case?

    
asked by Alcides Salazar 30.12.2016 в 18:02
source

2 answers

3

Try the following:

row.Cells(0).Style.BackColor = Color.FromArgb(1, 1, 1)
    
answered by 30.12.2016 в 18:27
1

If your DataGridView is called a grid, use the following:

in the RowEnter event of your grid, type

grilla.Rows [e.RowIndex] .DefaultCellStyle.BackColor = Color.FromArgb (209, 227, 254);

    
answered by 30.12.2016 в 19:39