title: C# checking listview checkbox depending upon the items matching the array
body: <p>I m new in C# programming. I m running into a problem. the problem is that. I have listview control in a winform application. Listview has checkboxes. first Column of a listview contains the IDs that comes from database. </p>
  
  <p>I also have an array which I have written like this</p>
  
  <pre><code>string selectCompany = "1,2,3,4";
  companies = selectCompany.Split(new String[] { "," }, StringSplitOptions.None);
  </code></pre>
  
  <p>All I want to do is if any value in the first column of listview is in above array, I need to check that row.
  How can this be achieved? 
  Any help will highly be appreciated.</p>
  
  <p><strong>Update</strong>
  The code I have so far is</p>
  
  <pre><code>string selectCompany = "1,2,3,4";
  companies = selectCompany.Split(new String[] { "," }, StringSplitOptions.None);
  foreach (DataRow row in company.Rows)
  {
      string[] rows = { row["type_id"].ToString(), row["type_name"].ToString()};
      var listViewItem = new ListViewItem(rows);
  
      lstCompanyType.Items.Add(listViewItem);
      if (companies.Length &gt; 0)
      {
          if (companies.Contains(row["type_id"]))
          {
              //i m JUST NOT SURE HOW TO CHECK LISTVIEW ITEMS THAT MATCHES THE ARRAY
          }
      }
      serialno++;
  }
  </code></pre>
  
  <p>Thanks</p>