Supress Alternating Row Style for Specific Data Grid Column?

  • Thread starter Thread starter Daniel Manes
  • Start date Start date
D

Daniel Manes

My DataGridView is set up like this:
* Main row background color = white
* Alternating row background color = light gray

I also have a read-only (non-editable) column I want to show up as
solid dark gray (i.e., no alternating row colors), but it shows up as
alternating dark/light gray.

Is there any way to get around this?

Thanks,

-Dan
 
Never mind...turned out I needed to use CellTemplate.Style.BackColor
instead of DefaultCellStyle.BackColor.

-Dan
 
You can subscribe to the DataGridView's RowsAdded event. Each time a row is
added, you can set the style of the desired column. This would be a fast fix
to that.
 
Back
Top