I have a method in which return me selectList. The certain items of selectList are to be programatically removed on the basis of Key.
public SelectList GetRoutingActionList()
{
Dictionary<string, string> routingActions = new Dictionary<string, string> {
{ "Approved", "Approve" },
{ "Return To", "Return To .." },
{ "Return To Sender", "Return To Sender" },
{ "Disapprove", "Disapprove" },
{ "Set On Hold", "Set On Hold" }
};
SelectList routingActionList = new SelectList(routingActions, "Key", "Value");
return routingActionList;
}
For eaxmple , I have to remove the item with Key "Disapprove". Could any one kindly help me to solve this.
routingActions.Remove("Disapprove")
? – Izolaiztaccihuatl