title: Using loops to get at each item in a ListView?
body: <p>What is a nice and effective way of getting at each item in a ListView of more than one column using loops?</p>
  
  <p>After doing a fair bit of digging around I couldn't really find anything so I when I did find something I wanted to share it on here see if people have better ways of doing it. Also sort of like preempting a question that is bound to come up as I was scratching my head for a bit thinking how do ??? eerrrr .... I ?</p>
  
  <p>I like this website so I wanted to share my solution to the question above. Sort of backwards I know but still, I know it will help someone out somwhere. = )</p>
  
  <pre><code>    private ArrayList getItemsFromListViewControl()
      {                      
          ArrayList lviItemsArrayList = new ArrayList();
  
          foreach (ListViewItem itemRow in this.loggerlistView.Items)
          {
              //lviItemsArrayList.Add(itemRow.Text); &lt;-- Already included in SubItems so ... = )
  
              for (int i = 0; i &lt; itemRow.SubItems.Count; i++)
              {
                  lviItemsArrayList.Add(itemRow.SubItems[i].Text);
                  // Do something useful here, for example the line above.
              }
          }
          return lviItemsArrayList;
      }
  </code></pre>
  
  <p>This returns a linear array based representation of all the items belong to a targeted ListView Control in an ArrayList collection object.</p>