从下拉列表中删除特定的值索引
问题描述:
如何从下拉列表中删除行的特定索引
How can i delete or remove a specific index of row from dropdown
答
在DropDownList的ListItemCollection上调用RemoveAt:
http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.listitemcollection.removeat.aspx [
Call RemoveAt on the ListItemCollection of the DropDownList:
http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.listitemcollection.removeat.aspx[^]
e.g.
var index = 3;
dropDownList1.Items.RemoveAt(index);