Changing the color of selected row

Mar 11, 2009 at 10:50 PM
Hi!

How can I change the colors of selected rows?

I've tried to use the overriding rows examples. It works fine, but when I select a row, the background and foreground colors turn to white.
I can't see where I can change this color values.

Help me please.

Thanks.

Mike
Coordinator
Mar 30, 2009 at 3:49 PM
Hi Mike,

If you want to change the row background colour then you will need to add some code in RowSection.PaintBackground or your derived class with something like:

gs.Graphics.FillRectangle( Brushes.Blue, HostBasedRectangle );


This will change the background to blue.

HTH

Regards
Lee

Mar 30, 2009 at 6:47 PM
Hi!

Thanks for answer.

My problem isn't changing the row background colour.
When I use FillRectangle method with "Example of overriding rows", the row background colour works fine.
The problem is in the selected rows! I don't know how to change the selected row background and foreground colours.

Best regards.

Mike
Coordinator
Apr 4, 2009 at 6:27 AM
Mike,

In RowSection there is a method called PaintSelection I believe this is where the colouring is handled.

Regards
Lee