TTMSFNCSearchEdit [How to populate]

Hello,

I do not understand how to populate a TTMSFNCSearchEdit.
I have only one category. I read data in a table [id, name ORDER BY name]. Tthe appropriate field on which to base the search is [name] and the returned value is [id].
My
problem is  the organization "category/column/item". I looked at SLDemo.lpi. This example does not work beacause the file *.txt are missing.

Will you help me?  Thanks.
Regards.


http://s000.tinyupload.com/?file_id=99500102082042887565

The number of columns is set via TMSFNCSearchEdit.Columns.
The items itself via TMSFNCSearchEdit.Items.

So, to fill the list with just one column, this can be done via:


  TMSFNCSearchEdit1.Columns.Clear;
  TMSFNCSearchEdit1.Columns.Add;

  TMSFNCSearchEdit1.Items.Clear;
  TMSFNCSearchEdit1.Items.Add('123');
  TMSFNCSearchEdit1.Items.Add('465');
  TMSFNCSearchEdit1.Items.Add('abc');
  TMSFNCSearchEdit1.Items.Add('xyz');

To setup the TTMSFNCSearchEdit with 2 columns, the code becomes:

  TMSFNCSearchEdit1.Columns.Clear;
  TMSFNCSearchEdit1.Columns.Add;
  TMSFNCSearchEdit1.Columns.Add;

  TMSFNCSearchEdit1.Items.Clear;
  TMSFNCSearchEdit1.Items.Add('123');
  TMSFNCSearchEdit1.Items[0].Columns.Add.Caption := '0';
  TMSFNCSearchEdit1.Items.Add('465');
  TMSFNCSearchEdit1.Items[1].Columns.Add.Caption := '1';
  TMSFNCSearchEdit1.Items.Add('abc');
  TMSFNCSearchEdit1.Items[2].Columns.Add.Caption := '2';
  TMSFNCSearchEdit1.Items.Add('xyz');
  TMSFNCSearchEdit1.Items[3].Columns.Add.Caption := '3';

Hello,
@Dmitruk Pawel:
Thank you. SLDemo.lpi is now complete.

@Bruno Fierens,

Thank you very much for the help you have given.

New problems :

  1. TMSFNCSearchEdit1.Columns[int].Visible := False; does not seem to be working.
  2. With SLdemo project and my PC dual screen, if the form is opened in the middle of the secondary screen (right screen), the list box of TMSFNCSearchEdit1 appears along the right side of the primary screen (left srceen).

Windows 7 [64] - Lazarus 1.6.2 [2016-02-14] FPC 3.0.0. [SVN 51630] i386-win32

Regards.

Thanks for reporting. We traced & fixed this issue. The next update will address this.