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
You probably need to add the following to the list of USING statements at the top of the file:
USING System.Windows.Forms.*.
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?
Yes I used Visual Designer in Progress, and I want to add an Item and to its SubItems :)
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.
Can you show me the syntax? On just how to add Items to listview subitems . Please ?
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).
Thank you very much sir. Your awesome thanks again. :)
DEFINE VARIABLE lvi AS ListViewItem.
I'm Sorry sir, but this line is having an error it keeps on telling invalid datatype.
You probably need to add the following to the list of USING statements at the top of the file:
USING System.Windows.Forms.*.
I tried it sir and it works, thank you very much. :)
Did you add the following line to the USING statements at the top of the file?
USING System.Windows.Forms.*.
it works now sir. Thank you very much for your help. :)