title: Remove items from ListBox when DataSource is set
body: <p>See I have a HashSet with several values, this values can contain for example numbers like <strong>4141234567</strong>, <strong>4241234567</strong>, <strong>4261234567</strong> and so on. I put a radioButton1 in my UserControl and I want when I click this just the numbers with 414 and 424 remains on my ListBox, for that I wrote this code:</p>
  
  <pre><code>private void radioButton1_CheckedChanged(object sender, EventArgs e)
      {
          var bdHashSet = new HashSet&lt;string&gt;(bd);
  
          if (openFileDialog1.FileName.ToString() != "")
          {
              foreach (var item in bdHashSet)
              {
                  if (item.Substring(1, 3) != "414" || item.Substring(1, 3) != "424")
                  {
                      listBox1.Items.Remove(item);
                  }
              }
          }
      }
  </code></pre>
  
  <p>But when I run the code I get this error:</p>
  
  <blockquote>
    <p>Items collection cannot be modified when the DataSource property is set.</p>
  </blockquote>
  
  <p>What is the proper way to remove the non wanted items from the list without remove them from the HashSet? I'll add later a optionButton for numbers that begin with 0416 and 0426 and also a optionButton to fill the listBox with original values, any advice? </p>