PDA

View Full Version : Colouring a CGXDaoGrid



Kyudos
09-02-2010, 02:39 PM
I have a grid with a hidden 'type' column and I'd like to highlight certain ROWS in the grid based on the value of 'type'.

Where is the best place to do this?

At first I tried GetStyleRowCol, but since you can't evaluate a cell value in GetStyleRowCol (all value 'get' functions seem to call GetStyleRowCol), this is tricky.

I also tried in OnDrawItem, which works...sort of. I wanted to draw a coloured background then the text, but without extracting all the cell drawing code into OnDrawItem. So I drew a solid filled rect and then called the default CGXDaoGrid::OnDrawItem for the text. It works, but when you cursor over the coloured cells and move away, they redraw in the standard colour.

Any suggestions on how to achieve this?

Cheers