I thought PaintParts indicates which parts should be painted by default. It seems to work OK but when the DataGridViewCell is selected, everything is painted by default. I just want to paint everything but the Content, here is my code:
private void dataGridView_RowPrePaint(object sender, DataGridViewRowPrePaintEventArgs e){
e.PaintParts = DataGridViewPaintParts.All & ~DataGridViewPaintParts.ContentForeground;
}
It works OK when the cell is not selected, however if I select a cell, it's painted by default with all background and content. The default/standard DataGridView
works OK but I'm dealing with a custom/third party DataGridView
.
Could you please explain to me what that is and give me some solution for that?
Thanks a lot!