Recent

Author Topic: Duplicating StringGrid  (Read 3667 times)

asdf

  • Sr. Member
  • ****
  • Posts: 310
Duplicating StringGrid
« on: February 05, 2011, 01:31:55 pm »
Picture 1. & 1a = In small/test project, it worked well.
----------------------------------------------------

But in my real project, it had error message.

Picture 2 = My real project.

Picture 3 = The error message.

In previous tabsheet, FixedAssetRegisterBodyStringGrid.FixedRows:=3;
In this tabsheet, if I use DepreciationHeaderStringGrid.RowCount:= 4, it is ok.
But if I used DepreciationHeaderStringGrid.RowCount:= FixedAssetRegisterBodyStringGrid.FixedRows +1; , it shows error message(Picture 3).
Lazarus 1.2.4 / Win 32 / THAILAND

Blaazen

  • Hero Member
  • *****
  • Posts: 3237
  • POKE 54296,15
    • Eye-Candy Controls
Re: Duplicating StringGrid
« Reply #1 on: February 05, 2011, 01:45:55 pm »
I think it is clear. Error message tells you what to do.
Simply swap two lines:

StringGrid2.RowCount:=StringGrid1.RowCount;
StringGrid2.FixedRows:=StringGrid1.FixedRows;

because you must at first add rows and then decide how many of them  will be "header".
Lazarus 2.3.0 (rev main-2_3-2863...) FPC 3.3.1 x86_64-linux-qt Chakra, Qt 4.8.7/5.13.2, Plasma 5.17.3
Lazarus 1.8.2 r57369 FPC 3.0.4 i386-win32-win32/win64 Wine 3.21

Try Eye-Candy Controls: https://sourceforge.net/projects/eccontrols/files/

asdf

  • Sr. Member
  • ****
  • Posts: 310
Re: Duplicating StringGrid
« Reply #2 on: February 05, 2011, 02:59:56 pm »
OMG!

Thank you so much Blaazen, it really worked :D .
Lazarus 1.2.4 / Win 32 / THAILAND

 

TinyPortal © 2005-2018