how do i color a selected row blue on a dbgrid which has the rowselect =
true when the user click (select) on it ?
TGridDrawState defines the possible states of a cell when drawing occurs.
Unit
Grids
type TGridDrawState = set of (gdSelected, gdFocused, gdFixed);
Description
TGridDrawState defines the possible states of cell when drawing occurs. The
TGridDrawState is the type of method parameters used for grid objects.
TGridDrawState can represent a value that includes zero or more of the
following:
Value Meaning
gdSelected The cell in the grid is selected.
gdFocused The cell in the grid has input focus.
gdFixed The cell is in the fixed (nonscrolling) region of the grid.
if State = gdSelected then
(Sender as TDbGrid).Canvas.Color := clBlue
else if DataCol = 2 then
(Sender as TDbGrid).Canvas.Color := clGreen;
This will color the background of the cells. To color the text use
"Canvas.Font".