dropdownlist绑定数据源后,运行程序,总是自动选择第一条数据,我想让他默认不选择任何数据,怎样设定才能做到?

解决方案 »

  1.   

    绑定后
    yourdropDownList.Items.Insert(new ListItem(0,""));
      

  2.   

    插入一个空行..
    Items.Insert(new ListItem(0,""));
      

  3.   

    在程序初始化得时候
    加如下代码
    dplist.Items.Insert(new ListItem(0,"--请选择--"));
      

  4.   

    这样可以吗?怎么ListItem()类的第一个参数要求是string类型的啊!?
      

  5.   

    在绑定的同时插入一项this.DropDownList1.DataSource =ds;
    this.DropDownList1.DataTextField ="字段一";
    this.DropDownList1.DataValueField ="字段二";
    this.DropDownList1.Items.Insert(0,"---请选择---");
    this.DropDownList1.DataBind();
      

  6.   

    this.DropDownList1.Items.Add("");
    this.DropDownList1.selectItem.text = "";