title: How do I disable a dropdownlist item based on a user selection on another drop down in ASP.NET?
body: <p>I have two drop down lists with a handful of items.</p>
  
  <p>If the user selects X, X needs to be disabled from the next drop down.</p>
  
  <p>If the user selects Y, Y needs to be disabled from the next drop down.</p>
  
  <p>And vice-versa. </p>
  
  <p>I tried this but it is not working:</p>
  
  <pre><code>protected void ddlSearchColumn1_SelectedIndexChanged(object sender, EventArgs e)
  {
      var ddl = (DropDownList) sender;
  
      string itemSelected = ddl.SelectedValue;
  
      ddlSearchColumn2.Items.FindByValue(itemSelected).Enabled = false;
  }
  </code></pre>
  
  <p>Can anyone give me a hand?</p>