Search code examples
delphidelphi-7

Changing the color of a single DBInspector row


I have a dxDBInspector that I need to highlight one row (edtSDate) out of nine in green. The color properties change the colors for all rows within the inspector.

I tried:

edtSDate.Inspector.Canvas.Brush.Color := clGreen;

I also saw How in a Delphi dxDBGrid can I change the color of a single row?

But the dxDBInspector does not have OnCustomDraw / OnGetContentStyle events.

The exact component is a dxDBInspector from Dev Express, and I am on Delphi 7.


Solution

  • Changing the variables in the OnDrawValue event fixed this for me. I was having trouble figuring this out because there was existing code (legacy project) that was auto assigning this event to make all inspectors match, but once I bypassed that it was simple.

    All I did was assign clGreen to the variable AColor created by the onDrawValue event for the row.