'How to remove/hide a Item in a @Html.DropDownListFor

I want to Remove/hide the 1st item from the @Html.DropDownListFor.This dropdown has four items. I want to remove/hide the 1st item only. But those values are not hard cord values, that are retrieved from the object of the model. I haven't so long experience in C# razor pages. Please help me to do that.

<div class="display-flex">
@Html.DropDownListFor(m => m.AdvancedMachingSavedListVM.Where(x => x.CharityException.AdvancedMatchingExceptionType.ID == savedItem.CharityException.AdvancedMatchingExceptionType.ID && x.CharityException.ID == savedItem.CharityException.ID).FirstOrDefault().CharityException.AdvancedMatchingExceptionType.ID, savedType, new { @id = "advancedmachingtype_" + @savedItem.CharityException.ID, @class = "ad_select no-p-space medium_dropdown", @onchange = "advancedmachingtypeChanged(" + savedItem.CharityException.ID + ")" })
</div>  


Solution 1:[1]

if you want to remove first item of a list you can simply use Skip method like this

//skip first item in list
myList.Skip(1).ToList();

I could not understand the meaning of your code. I hope this code helps you.

Solution 2:[2]

you can do it with jquery when the razor page is loaded within document.ready()

$("#advancedmachingtype_ option[value=" + title + "]").hide();

title will be the first index of dropdownlist

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 seyyed mohammad hosein kashfi
Solution 2 HamidrezaSh