LCL, fix dgTitles dbgrid option after emtpy grid, from Paul Ishenin, issue #15172

git-svn-id: trunk@22756 -
This commit is contained in:
jesus 2009-11-25 07:46:02 +00:00
parent 44b0233a93
commit aa050e518f

View File

@ -718,14 +718,15 @@ end;
procedure TCustomDBGrid.EmptyGrid;
var
OldFixedCols: Integer;
OldFixedCols, OldFixedRows: Integer;
begin
OldFixedCols := FixedCols;
OldFixedRows := FixedRows;
Clear;
ColCount := OldFixedCols + 1;
RowCount := 2;
RowCount := OldFixedRows + 1;
FixedCols := OldFixedCols;
FixedRows := 1;
FixedRows := OldFixedRows;
if dgIndicator in Options then
ColWidths[0]:=12;
end;
@ -1003,6 +1004,13 @@ begin
FixedCols := FixedCols - 1;
end;
if (dgTitles in ChangedOptions) then begin
if dgTitles in FOptions then
FixedRows := FixedRows + 1
else
FixedRows := FixedRows - 1;
end;
if (dgAutoSizeColumns in ChangedOptions) then begin
Exclude(FGridStatus, gsAutoSized);
end;