Are you looking for
procedure TForm1.DBGrid1DrawColumnCell(Sender: TObject; const [Ref] Rect: TRect;
DataCol: Integer; Column: TColumn; State: TGridDrawState);
Var
R: TRect;
begin
R:= Rect;
with DBGrid1.Canvas do
begin
Brush.Color:= clRed;
R.Offset(Column.Width, 0);
FillRect(R);
R:= System.Types.Rect(Rect.Left, Rect.Bottom - 1, Rect.Right, Rect.Bottom);
FillRect(R);
end;
end;
The results will be like:
A better way (from Tom Brunberg comment) is to use FrameRect()
as
procedure TForm1.DBGrid1DrawColumnCell(Sender: TObject; const [Ref] Rect: TRect;
DataCol: Integer; Column: TColumn; State: TGridDrawState);
begin
with DBGrid1.Canvas do
begin
Brush.Color:= clRed;
FrameRect(Rect);
end;
end;
Use FrameRect() to draw a 1 pixel wide border around a rectangular region, which does not fill the interior of the rectangle with the Brush pattern.
To draw a boundary using the Pen instead, use the Polygon method
grid line width
. So I guess one could assume "official" terminology as default, at least before downvoting – Tommietommy