To achieve this,Please follow below steps:
Make a List that you want to Remove from RadComboBox or DropDownList.
Here {"2","3","5","6","7","8","9","10" } are the values of RadComboBox or DropDownList Items.
- List<string> list = new List<string>() {"2","3","5","6","7","8","9","10" };
Then use foreach loop to achieve your goal.RadComboBox1
- foreach (var item in list)
- {
- RadComboBoxItem items = .Items.FindItemByValue(item);
- if (item != null)
- {
- items.Remove();
- }
- }
Here is the Full Code:
- List<string> list = new List<string>() {"2","3","5","6","7","8","9","10" };
- foreach (var item in list)
- {
- RadComboBoxItem items = RadComboBox1.Items.FindItemByValue(item);
- if (item != null)
- {
- items.Remove();
- }
- }