views:

25

answers:

1
private void CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
{
  if(whatever)
    e.CellStyle.BackColor = SystemColors.ControlDark;

This works fine for text columns but for combo box columns it makes no difference. I'd just as soon not make an owner draw control if there's a simpler way to do this.

Thanks, Spike

+1  A: 

I've searched my programs layout manager code looking for everything that is connected to DGV combobox columns and only BackColor and SelectionBackColor are set. If it changes anything we have style set to flat and this is working well(col.FlatStyle = FlatStyle.Flat).

kubal5003
FlatStyle.Flat makes it work, thanks heaps.I hadn't really noticed before but FlatStyle.Standard cells don't change color when they're selected either.
Spike