In our ASP.Net application (*NOT* MVC), we have a Kendo-UI dropdownlist that is populated in the Default.master file. The control itself is populated in an external "global" assembly, and I cannot alter the code in that assembly.
I want to remove an item from the ddl, but NOT from the collection the ddl is bound(?) to.
EDIT 2020.02.14 =============================
I fingered it out, but I'm not at work, and don't remember what it was that fixed it. I'll verify it on Tuesday (we have Monday off). I seem to remember that I needed to change the selector to something like
"#[ID*='ddlList']"
What I have tried:
I tried adding the following to the script section of the Default.master file:
$("#ddlList option[value='2']").remove();
and this:
$("#ddlList option[value='2']").hide();
and also this:
$("#ddlList").ajaxComplete(function()
{
$("#ddlList option[value='2']").remove();
}
EDIT =================
I also tried this (because of the arbitrary id decoration that ASP.Net does):
$("[ID*='ddlList'] option[value='2']").hide();
BTW, I have verified that the ddl contains the option I'm looking for, but hiding/disabling it doesn't seem to have any effect.
EDIT ======================
This:
$("[ID*='ddlList']").find("option.contains('2')").hide();
actually changes the desired option to this:
<option value="2" style="display:none;">2</option>
but the item is STILL displayed in the dropdown.