Board index » delphi » Controlling DBGrids drawing

Controlling DBGrids drawing

If DBGrids propertyes DefaultDrawing and Options/dgRowSelect are set
to true, selected row will be highlighted.

Now I want to use three colors with DBGrid. Green for rows allready
processed, red for rows waiting for process and blue for row that is
currently under process (is selected).

I know how to work with green and red, but

How do I work with blue row / How do I detect which row is selected
and draw it with blue

:) Marko

 

Re:Controlling DBGrids drawing


Quote
>If DBGrids propertyes DefaultDrawing and Options/dgRowSelect are set
>to true, selected row will be highlighted.

>Now I want to use three colors with DBGrid. Green for rows allready
>processed, red for rows waiting for process and blue for row that is
>currently under process (is selected).

>I know how to work with green and red, but

>How do I work with blue row / How do I detect which row is selected
>and draw it with blue

After too many tests I think there is bug in DBGrid compnent. In my
project I need some way to get information about what row is selected
when mouse button is pressed to draw right colors to grid.

I understud from manuals that OnColEnter should point to row that just
were selected, but it points to row that just lost focus.

Now Im totally lost, how could I get value from selected row before
OnDrawDataCell so I could controll drawing.

One way would be fixing DBGrids bug, but how to do that?

:) Marko

Other Threads