listview

  • Thread starter Thread starter Jan
  • Start date Start date
J

Jan

How can a place the contents of a listview into an array inc. the subitems.

newbee question

thx very much
 
* Jan said:
How can a place the contents of a listview into an array inc. the subitems.

Array of what? ListViewItems? Strings?
 
Hi Jan,

An array is not the best thing to put in listviewItems

A array is two dimensial
a table of rows with one item

A listview 3 dimensial
a table of rows which has columns which has items

I would use a datatable for that, others make there own collection I think.

a datatable goes like this (rough typed watch typos)

\\\
dim dt as new datatable
dim dc1 as new datacolumn
dim dc2 as new datacolumn
dt.columns.add(dc1)
dt.columns.add(dc2).
dim lvi as listviewitem
for each lvi in mylistview.items
dim dr as datarow = dt.newrow
dr.item(0) = lvi.subitem(1).text
dr.item(1) = lvi.subitem(2).text
dt.rows.add(dr)
next
///

I hope this helps a little bit?

Cor



Cor
 
* Jan said:
ListViewItems to a string

I don't think that there is an easier way than looping through the items
and their subitems and adding them to an array or arraylist.
 
Hi Jan,

An array is not the best thing to put in listviewItems

A array is two dimensial
a table of rows with one item

A listview 3 dimensial
a table of rows which has columns which has items

I would use a datatable for that, others make there own collection I think.

a datatable goes like this (rough typed watch typos)

\\\
dim dt as new datatable
dim dc1 as new datacolumn
dim dc2 as new datacolumn
dt.columns.add(dc1)
dt.columns.add(dc2).
dim lvi as listviewitem
for each lvi in mylistview.items
dim dr as datarow = dt.newrow
dr.item(0) = lvi.subitem(1).text
dr.item(1) = lvi.subitem(2).text
dt.rows.add(dr)
next
///

I hope this helps a little bit?

Cor



Cor

Thx, this tip helped
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top