I have a problem with drawinjg graphics from OwnerDrawCell event.
Everything seems quite simple, however...
Most of cells have black background. For one cell I draw a red color rectangle (not using a backcolor because ideally this rectangle should occupy just a half of the cell):
If eventArgs.Col = 4 And eventArgs.Row = 1 Then
g.FillRectangle(Brushes.Red, eventArgs.Bounds)
eventArgs.DrawCell()
Debug.WriteLine("special") ' just a test code to see the code executed
End If
However when I start the form the cell is not painted to red color. When I scroll the through columns the rectangle appears (not instantly). And even in this case something is going wrong as red rectangle can be smaller in width then the cell.
Another (but I believe related) problem is that when scrolling horisontally first column (fixed one) can be partially re-painted with this red color (or any other color we use) .
This code was working with old VS flexgrid and converted Ax flexgrid.