Managing Listview

Posted by Arjon Policar on 06-Apr-2016 18:42

Dear Everyone,

Greetings! I am new in this programming language and I'm still learning the basics. Can you help me to the syntax of adding an Item to a listview and to its subItems? Thank you, I hope you will help me.

Arjon Policar

Posted by Matt Gilarde on 07-Apr-2016 10:00

You probably need to add the following to the list of USING statements at the top of the file:

USING System.Windows.Forms.*.

All Replies

Posted by Matt Gilarde on 06-Apr-2016 18:59

We need to know how you are creating a Listview to know how to help you. Did you use Visual Designer in Progress Developer Studio to create a form with a Listview on it? Or are you creating the Llistview some other way?

Posted by Arjon Policar on 07-Apr-2016 07:13

Yes I used Visual Designer in Progress, and I want to add an Item and to its SubItems :)

Posted by Matt Gilarde on 07-Apr-2016 08:12

I can put together a simple example to demonstrate how to do this but it will take me a bit of time. If you want to move ahead faster you can do a web search for C# examples. Most C# code can be translated to OO ABL code fairly easily.

Posted by Arjon Policar on 07-Apr-2016 08:21

Can you show me the syntax? On just how to add Items to listview subitems . Please ?

Posted by Matt Gilarde on 07-Apr-2016 08:51

First, make sure that the View property of your Listview is set to "Details".

You can add columns like this:

    listView1:Columns:Add("Name").
    listView1:Columns:Add("Age").
    listView1:Columns:Add("Country").

You can add items and subitems like this:

    DEFINE VARIABLE lvi AS ListViewItem.
    lvi = NEW ListViewItem("James").
    lvi:SubItems:Add("26").
    lvi:SubItems:Add("USA").
    listView1:Items:Add(lvi).

Posted by Arjon Policar on 07-Apr-2016 09:00

Thank you very much sir. Your awesome thanks again. :)

Posted by Arjon Policar on 07-Apr-2016 09:51

DEFINE VARIABLE lvi AS ListViewItem.

I'm Sorry sir, but this line is having an error it keeps on telling invalid datatype.

Posted by Matt Gilarde on 07-Apr-2016 10:00

You probably need to add the following to the list of USING statements at the top of the file:

USING System.Windows.Forms.*.

Posted by Arjon Policar on 07-Apr-2016 10:13

I tried it sir and it works, thank you very much. :)

Posted by Matt Gilarde on 07-Apr-2016 10:17

Did you add the following line to the USING statements at the top of the file?

USING System.Windows.Forms.*.

Posted by Arjon Policar on 07-Apr-2016 10:21

it works now sir. Thank you very much for your help. :)

This thread is closed