Author Topic: [SOLVED] Problem with text search  (Read 412 times)


  • Jr. Member
  • **
  • Posts: 65
[SOLVED] Problem with text search
« on: July 13, 2019, 04:11:30 pm »
I'm trying to use this interesting component for the first time (thanks for your work  :)). I found a problem that I don't understand, because when I perform a text search, many unwanted lines are automatically added?

This does not happen if the text is not found.

Windows 10 64bit
Lazarus 2.0.2 FPC 3.0.4 64bit
Library: latest version

Attack the source for the test

Thanks for any help
« Last Edit: July 13, 2019, 05:58:34 pm by Phoenix »


  • Hero Member
  • *****
  • Posts: 7204
Re: Problem with text search
« Reply #1 on: July 13, 2019, 05:15:02 pm »
The new rows that you see are not rows of the worksheet but rows of the grid. The grid by default expands the rows and columns defined in the worksheet so that the user has a visual impression like in the Office applications. You can turn off this behavior when you remove "aeDefault" from the "AutoExpand" options of the worksheet.
Code: Pascal  [Select][+][-]
  1.  Grid:= TsWorksheetGrid.Create(Self);
  2.  with Grid do
  3.  begin
  4.   [...]
  5.   AutoExpand := AutoExpand - [aeDefault];
  6.   [...]
  7.  end;

BTW, your demo project probably has copies of the fpspreadsheet units in its own folder. You can do this, but you should be aware that this is not the standard way to work with external libraries in Lazarus. Go to "Package" > "Open package file" and navigate to the folder to which you had downloaded the fpspreadsheet fies. Load the package file "laz_fpspreadsheet.lpk" and click "Compile". Repeat with "laz_fpspreadsheet_visual.lpk" and "laz_fpspreadsheet_visual_dsgn.lpk". In case of the latter file then click "Use" > "Install" to install the visual components into the IDE. If you want to use units in a project, open the project options, click on "Add" > "New Requirement" and select the package from the list. If you primarily work with the visual components such as the worksheetgrid simply select the component from the component palette and drop it on the form. Do NOT set the unit path in the project options to the directories containing the package units; if you have done the package compilation and installation the IDE knows where to find the compiled units.

Another remark: When you create the worksheet grid by code and pass a non-nil parameter to the Create constructor then you should not explicitly free the grid yourself because the component that you specified in Create will automatically do this.
Lazarus trunk / fpc 3.0.4 / all 32-bit on Win-10


  • Jr. Member
  • **
  • Posts: 65
Re: Problem with text search
« Reply #2 on: July 13, 2019, 05:57:26 pm »
your demo project probably has copies of the fpspreadsheet units in its own folder
Yes, I have a personal preference for using libraries without installing them. So usually I create them by code. However I agree that the standard method is installation.

Many thanks for the solution and advice!!  :D


TinyPortal © 2005-2018