Skip to main content

Is it possible to set the background colour of any given cell to one other than the default.

This is in respect to being able to set the cells to READONLY or not ok.

In the event the cell is READONLY I'd also like to set the background colour of the cell to a meaningful colour to indicate to the user that the cell IS a READONLY cell and that the data inside that cell cannot be edited.

Thanks. 

Is it possible to set the background colour of any given cell to one other than the default.

This is in respect to being able to set the cells to READONLY or not ok.

In the event the cell is READONLY I'd also like to set the background colour of the cell to a meaningful colour to indicate to the user that the cell IS a READONLY cell and that the data inside that cell cannot be edited.

Thanks. 

Yes, you can set the background color of the individual cells in the same place where you set the ReadOnly property.

Example:

    set dataGridView1::Rows[sub-1]::Cells["Amount"]::ReadOnly to true
    set dataGridView1::Rows[sub-1]::Cells["Amount"]::Style::BackColor to type Color::Red