DropDownList.Items的常用方法
DropDownList.Items的常用方法
在最后一项添加:DropDownList.Items.Add("text");
or
DropDownList.Items.Add(new ListItem("text","value"));
在指定的位置添加一项:
DropDownList.Items.Insert(index, new ListItem("text","value"));
移除指定的项:
DropDownList.Items.Remove("text");
or
DropDownList.Items.RemoveAt(index);
移除所有的项:
DropDownList.Items.Clear();
项的总数:
DropDownList.Items.Count
版权所有djune@博客园 一个前端爱好者,迷恋交流与分享的快感。。。