I have created a custom DataGridView cell class for both display and editing.
The cell paints its own background. The edit control, which is based on the TextBox clasl sits in the middle of the cell height so there is space above and below it.
For display all is ok.
However when I go into edit mode in my cell, something somewhere is repainting the cell background to the default cell style background colour and I can't see where or how to override/stop this.
So say the default cell style is white. I paint my custom cell background to yellow. When displaying, all is ok and the background is yellow.
As soon as I enter edit mode, my edit control becomes active. I can set the background of my edit control to yellow ok to match the background of the rest of my cell but the rest of the cell not covered by the edit control , i.e the space above and below it, changes to white, the default cell style backgoround as soon as the first key is pressed and edit mode becomes active. Debuggiing shows my cell painting code is being executed but something in the datagridview elsewhere is resetting the background colour of the none editing parts of my cell when edit mode is entered.
I want my custom background painting forthe whole cell to be there when displaying and editing.