Board index » delphi » Help with DBGrid changing selected row color

Help with DBGrid changing selected row color

I am having difficulty figuring out how to change the color of the selected
row in a DBGrid.  I thought that I could use the OnDrawCell event and just
test if the current row being drawn was the selected row.  However, I am
having trouble now figuring out how to test if the current row is the
selected row.  In a DBGrid, can you help me :
1) Change the color of the selected row
2) Understand how to identify which row is selected?

Please e-mail your reply to l...@warren.med.harvard.edu

Thanks,

Lee Reynolds

 

Re:Help with DBGrid changing selected row color


On 15 Mar 1998 15:29:40 GMT, "Lee Reynolds"

Quote
<l...@warren.med.harvard.edu> wrote:
>I am having difficulty figuring out how to change the color of the selected
>row in a DBGrid.  I thought that I could use the OnDrawCell event and just
>test if the current row being drawn was the selected row.  However, I am
>having trouble now figuring out how to test if the current row is the
>selected row.  In a DBGrid, can you help me :
>1) Change the color of the selected row
>2) Understand how to identify which row is selected?

>Please e-mail your reply to l...@warren.med.harvard.edu

>Thanks,

>Lee Reynolds

The State parameter will  be gdSelected if the cell you're drawing is
selected. BTW, If you're using D3, the OnDrawColumnCell is recommended
as OnDrawDataCell has become obsolete.

Steve F (Team B)

Other Threads