Home Forums WinForms controls Xceed Grid for WinForms PaintBackground override problem

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #15050 |

    Hi

    I override the paintbackground function in my application for DataCell and thereby draw it myself. This worked fine until the last version 3.5. My app now still draws all OK except the selected row’s cells that are not the selected cell (These still seem to be drawn by xceed not me). Is there a new setting or way of doing this. Lets assume I want to draw the selected line yellow (I know this would be stupid but just for ex) my selected row would have the selected cell being yellow and the rest of the row blue (xceed default highlight color) ???. In the old version the entire row would have been yellow. I’ll still check my code, but please advise if somethings changed ??

    Just quickly made the following change below to PaintBackground, thus all cells should have a yellow background. This is not the case however for the selected row ?

    protected override void PaintBackground(GridPaintEventArgs e)
    {
    Rectangle ARect = e.ClientRectangle;
    using (Brush b = new SolidBrush(Color.Yellow))
    e.Graphics.FillRectangle(b,ARect);
    }

    Regards
    Greg

    Imported from legacy forums. Posted by g.kroger (had 1816 views)

    User (Old forums)
    Member
    Post count: 23064

    You will need to move your code to the OnPaintForeground of the DataCell, or during the OnPaintSelectedState of the DataRow, because the selection is painted over the cells.

    Imported from legacy forums. Posted by André (had 2864 views)

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.