diff --git a/components/fpspreadsheet/fpspreadsheetgrid.pas b/components/fpspreadsheet/fpspreadsheetgrid.pas index cc34f4c1d..e8d43ce3a 100644 --- a/components/fpspreadsheet/fpspreadsheetgrid.pas +++ b/components/fpspreadsheet/fpspreadsheetgrid.pas @@ -144,6 +144,7 @@ type out ACol1, ACol2: Integer; var ARect: TRect): Boolean; procedure CreateNewWorkbook; procedure DblClick; override; + procedure DoOnResize; override; procedure DoPrepareCanvas(ACol, ARow: Integer; AState: TGridDrawState); override; procedure DrawAllRows; override; procedure DrawCellBorders; overload; @@ -1138,6 +1139,13 @@ begin inherited DblClick; end; +procedure TsCustomWorksheetGrid.DoOnResize; +begin + if (csDesigning in ComponentState) and (Worksheet = nil) then + NewWorkbook(FInitColCount, FInitRowCount); + inherited; +end; + {@@ ---------------------------------------------------------------------------- Adjusts the grid's canvas before painting a given cell. Considers background color, horizontal alignment, vertical alignment, etc. @@ -2912,6 +2920,7 @@ procedure TsCustomWorksheetGrid.Loaded; begin inherited; if FWorkbookSource = nil then + // CreateNewWorkbook; NewWorkbook(FInitColCount, FInitRowCount); end;