DataGridView keep SelectionColor

0
0

Hi,

I have a grid and in the event DataBindingComplete, I try  to set BackColor for each row depending on its data

foreach (DataGridViewRow row in dataGridView.Rows)

{

row.DefaultCellStyle.BackColor = Color.Red;

}

The problem is when I select a row, it keeps the background color from the code, not the selected-row-color as usual. Is anyway to keep selected-row-color?

Thank for your helps,

Page

 

  • You must to post comments
0
0

Yes the color (text and background) set by code is preserved bu design. We have an enhancement request logged to optionally override the colors with the selection theme color but there is no implementation plan yet. We have a workaround but it’s not easy to use and not complete.

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.