newpdv
newpdv

Reputation: 462

Delphi 7 - TDBGrid style

How to use stylized table in Delphi 7? For example:

enter image description here

Upvotes: 0

Views: 1028

Answers (2)

mikia
mikia

Reputation: 454

I wrote and tested for you this example on Delphi 7 and Windows 8.1

Use Event DrawColumnCell to change color or something else.

procedure TForm1.DBGrid1DrawColumnCell(Sender: TObject; const Rect: TRect;DataCol: Integer; Column: TColumn; State: TGridDrawState);
begin
  try
    if Column.FieldName = 'FIRST_NAME' then
      DBGrid1.Canvas.Brush.Color := clGreen;
  finally
    DBGrid1.DefaultDrawColumnCell(Rect, DataCol, Column, State);
  end;
end;

Download full example: file

Upvotes: 1

RRUZ
RRUZ

Reputation: 136381

If you mean which you want themed the TDbGrid component, you can use the Themed DBGrid runtime replacement from Jeremy North's and Andreas Hausladen.

Upvotes: 5

Related Questions