title: ASP.NET: Remove specific item in Dropdownlist
body: <p>I'm doing a code for Time Start and Time End. So I did is manual coding.</p>
  
  <p>Here's my example gui:</p>
  
  <p>its HH:MM</p>
  
  <p><img src="https://i.stack.imgur.com/qDFpL.png" alt="enter image description here"></p>
  
  <p>Value for Hour is From 00 - 23 then for the Minutes is From 00 - 59</p>
  
  <p>Scenario:</p>
  
  <p>My Start Time will be 8:00 [8-Hour,00-Minutes], its also have an autopostback. So for the End Time of Hour it will not display the 00-07  for the Hour it will display only the number 8 to 23.</p>
  
  <p>Here's my code:</p>
  
  <pre><code>int _intDiff = _tmrStart - _tmrEnd;
  
  for (int x = 0; x &lt;= _intDiff; x++)
  {  
    DropDownList3.Items.Remove(DropDownList3.Items[x]);
  }
  </code></pre>
  
  <p>Its working but its displaying wrong output..</p>
  
  <p>Here's the example output:</p>
  
  <p><img src="https://i.stack.imgur.com/WwykA.png" alt="enter image description here"></p>
  
  <p>As you can see there, the program removes only the even number 00,02,04,06,08. How can I make that Staring from 00 - 07 will be remove in the dropdownlist?</p>