elements(list view)

  • Thread starter Thread starter juli jul
  • Start date Start date
J

juli jul

Hello,
How can I pass over all the elements that are in the first column of
listview?
I need to do it in a loop and to present each cell value,how?
Thank you!
 
Hi Juli,

ListView YourListView = new ListView();
ListView.ListViewItemCollection Coll = YourListView.Items;

Now you have the Collection ready to send it or to browse it.

Hope this helps
Salva
 
Hi Juli,

ListView YourListView = new ListView();
ListView.ListViewItemCollection Coll = YourListView.Items;

Now you have the Collection ready to send it or to browse it.

Hope this helps
Salva
 
It's not working - I don't have the collection property in list. Is
there some other way to get the list items?
 
Hi Juli,

Actually it is there, I have written a simple example:

System.Windows.Forms.ListView MyList = new System.Windows.Forms.ListView();

MyList.Items.Add("Test1");
MyList.Items.Add("Test2");

System.Windows.Forms.ListView.ListViewItemCollection Coll = MyList.Items;

foreach (object Entry in Coll)
{
System.Diagnostics.Debug.WriteLine(Entry.ToString());
}

MyList.Dispose();

This works perfectly fine,
Hope this helps

Salva
 
Back
Top