Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2022-11

How to populate a TListView programatically

7 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Aruna Hewapathirane

Hello Everyone,

I tried going through the fpc documentation and did some searching on Google and found this video on youtube:
https://www.youtube.com/watch?v=ohfG7KISNq0

The video did help me to understand what to do in the Lazarus IDE but I am unable to find any code that shows me how to populate a TListView programmatically/dynamically?

Does anyone have any example code that populates a Listview component through code please?

Thank you,

Aruna
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20221116/e880ead5/attachment.htm>

Reply by email

Matthieu Giroux
to Aruna Hewapathirane

I have created a TDBLIstView which populates a TListView with data.But you car test it.

Matthieu Giroux 13 Rue Fr Tanguy PRIGENT A.15 - 35000 RennesT?l : 02 23 46 06 54 - 06 44 733 008 http://www.liberlog.fr

Le jeudi 17 novembre 2022 ? 00:03:29 UTC+1, Aruna Hewapathirane via lazarus a ?crit :

Hello Everyone,
I tried going through the fpc documentation and did some searching on Google and found this video on youtube: https://www.youtube.com/watch?v=ohfG7KISNq0 The video did help me to understand what to do in the Lazarus IDE but I am unable to find any code that shows me how to populate a TListView programmatically/dynamically?

Does anyone have any example code that populates a Listview component through code please?

Thank you,
Aruna

Reply by email

Werner Pamler
to Aruna Hewapathirane: I tried going through the fpc documentation and did some searching on Google and found…
Aruna Hewapathirane wrote
Does anyone have any example code that populates a Listview component through code please?
procedure TForm1.FormCreate(Sender: TObject);
var
 ? item: TListItem;
 ? i: Integer;
begin
 ? for i := 0 to 9 do
 ? begin
 ??? item := ListView1.Items.Add;
 ??? item.Caption := 'Item ' + IntToStr(i);
 ??? item.SubItems.Add('Subitem ' + IntToStr(i) + '/1');
 ??? item.SubItems.Add('Subitem ' + IntToStr(i) + '/2');
 ??? item.ImageIndex := i;
 ??? item.SubItemImages[0] := i+1;
 ??? item.SubItemImages[1] := i+2;
 ? end;
end;

Reply by email

Aruna Hewapathirane
to Matthieu Giroux: I have created a TDBLIstView which populates a TListView with data.But you car test it.…
PM Matthieu Giroux wrote
I have created a TDBLIstView which populates a TListView with data. But you car test it.

Do you have a link to the code please?

Show quoted text 32 lines
Matthieu Giroux 13 Rue Fr Tanguy PRIGENT A.15 - 35000 Rennes T?l : 02 23 46 06 54 - 06 44 733 008 http://www.liberlog.fr Le jeudi 17 novembre 2022 ? 00:03:29 UTC+1, Aruna Hewapathirane via lazarus a ?crit : Hello Everyone, I tried going through the fpc documentation and did some searching on Google and found this video on youtube: https://www.youtube.com/watch?v=ohfG7KISNq0 The video did help me to understand what to do in the Lazarus IDE but I am unable to find any code that shows me how to populate a TListView programmatically/dynamically? Does anyone have any example code that populates a Listview component through code please? Thank you, Aruna -- _______________________________________________ lazarus mailing list https://lists.lazarus-ide.org/listinfo/lazarus

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20221116/029f311d/attachment-0001.htm>

Reply by email

Aruna Hewapathirane
to Werner Pamler: procedure TForm1.FormCreate(Sender: TObject); var ? item: TListItem; ? i: Integer; begin…

On Wed, Nov 16, 2022 at 6:29 PM Werner Pamler via lazarus <

Show quoted text 23 lines
wrote: Am 17.11.2022 um 00:03 schrieb Aruna Hewapathirane via lazarus: > Does anyone have any example code that populates a Listview component > through code please? procedure TForm1.FormCreate(Sender: TObject); var item: TListItem; i: Integer; begin for i := 0 to 9 do begin item := ListView1.Items.Add; item.Caption := 'Item ' + IntToStr(i); item.SubItems.Add('Subitem ' + IntToStr(i) + '/1'); item.SubItems.Add('Subitem ' + IntToStr(i) + '/2'); item.ImageIndex := i; item.SubItemImages[0] := i+1; item.SubItemImages[1] := i+2; end; end; --

This is exactly what I was looking for. It is the subitems that was giving me a real problem.
Thank you very much Werner.

Show quoted text 5 lines
_______________________________________________ lazarus mailing list https://lists.lazarus-ide.org/listinfo/lazarus

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20221116/2be7b1ba/attachment.htm>

Reply by email

Matthieu Giroux
to Aruna Hewapathirane: On Wed, Nov 16, 2022 at 6:20 PM Matthieu Giroux Do you have a link to the code please?…

It is Extended suite :Download XML Frames BPM VRAD Lazarus from SourceForge.net

|
|
| |
Download XML Frames BPM VRAD Lazarus from SourceForge.net

Your download will start shortly...
|

|

|

Matthieu Giroux 13 Rue Fr Tanguy PRIGENT A.15 - 35000 RennesT?l : 02 23 46 06 54 - 06 44 733 008 http://www.liberlog.fr

Le jeudi 17 novembre 2022 ? 02:29:24 UTC+1, Aruna Hewapathirane a ?crit :

On Wed, Nov 16, 2022 at 6:20 PM Matthieu Giroux wrote:

I have created a TDBLIstView which populates a TListView with data.But you car test it.

Do you have a link to the code please?
?

Matthieu Giroux 13 Rue Fr Tanguy PRIGENT A.15 - 35000 RennesT?l : 02 23 46 06 54 - 06 44 733 008 http://www.liberlog.fr

Le jeudi 17 novembre 2022 ? 00:03:29 UTC+1, Aruna Hewapathirane via lazarus a ?crit :

Hello Everyone,
I tried going through the fpc documentation and did some searching on Google and found this video on youtube: https://www.youtube.com/watch?v=ohfG7KISNq0 The video did help me to understand what to do in the Lazarus IDE but I am unable to find any code that shows me how to populate a TListView programmatically/dynamically?

Does anyone have any example code that populates a Listview component through code please?

Thank you,
Aruna

Reply by email

Aruna Hewapathirane
to Matthieu Giroux
AM Matthieu Giroux wrote 12 lines
It is Extended suite : Download XML Frames BPM VRAD Lazarus from SourceForge.net <https://sourceforge.net/projects/xml-frames-vrad-lazarus/files/ExtendedPackages.zip/download> Download XML Frames BPM VRAD Lazarus from SourceForge.net Your download will start shortly... <https://sourceforge.net/projects/xml-frames-vrad-lazarus/files/ExtendedPackages.zip/download>

Thank you Matthieu.

Show quoted text 53 lines
Matthieu Giroux 13 Rue Fr Tanguy PRIGENT A.15 - 35000 Rennes T?l : 02 23 46 06 54 - 06 44 733 008 http://www.liberlog.fr Le jeudi 17 novembre 2022 ? 02:29:24 UTC+1, Aruna Hewapathirane < > a ?crit : On Wed, Nov 16, 2022 at 6:20 PM Matthieu Giroux wrote: I have created a TDBLIstView which populates a TListView with data. But you car test it. Do you have a link to the code please? Matthieu Giroux 13 Rue Fr Tanguy PRIGENT A.15 - 35000 Rennes T?l : 02 23 46 06 54 - 06 44 733 008 http://www.liberlog.fr Le jeudi 17 novembre 2022 ? 00:03:29 UTC+1, Aruna Hewapathirane via lazarus a ?crit : Hello Everyone, I tried going through the fpc documentation and did some searching on Google and found this video on youtube: https://www.youtube.com/watch?v=ohfG7KISNq0 The video did help me to understand what to do in the Lazarus IDE but I am unable to find any code that shows me how to populate a TListView programmatically/dynamically? Does anyone have any example code that populates a Listview component through code please? Thank you, Aruna -- _______________________________________________ lazarus mailing list https://lists.lazarus-ide.org/listinfo/lazarus

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20221117/9177cf84/attachment.htm>

Reply by email