C#实现对DropDowList添加下拉选项的方法

1.在指定下标处添加:

DropDownList.Items.Insert(2, new ListItem("Title", "Value"));

2.在已存在的选择下添加:

 DropDownList.Items.Add(new ListItem("Title", "Value"));
 DropDownList.Items.Add("Value");

3.在某个控件里面添加:

 ((DropDownList)wfvMaster.FindControl("DropDownList1")).Items.Add("Value");

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-19
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-10-25
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-03
相关资源
相似解决方案