Category: Components
Title: Change the DefaultRowHeight of a TDBGrid
Date added: 15.03.2006
Hits: 2526
type
TMyDBGrid = class(TDBGrid)
public
property DefaultRowHeight;
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.FormCreate(Sender: TObject);
begin
DbGrid1.Canvas.Font.Size := 13;
TMyDBGrid(DBGrid1).DefaultRowHeight := DBGrid1.Canvas.TextHeight('MMMMM') + 4;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
DBGrid1.DataSource.DataSet.DisableControls;
TStringGrid(DBGrid1).DefaultRowHeight := 55;
DBGrid1.DataSource.DataSet.EnableControls;
end;