c# 的代码看不太懂,不过最简单的做法是 手动在
第一项添加 select 行

解决方案 »

  1.   

    DropDownList1.Items[index].Selected = true;就可以了
      

  2.   

    FindByValue方法返回其值为指定字符串的ListItem,而不是选中它,所以你的代码中
    DropDownList1.Items.FindByValue(type);
    没有任何作用,你可以改为这样:ListItem lItem=DropDownList1.Items.FindByValue(type);
    if(lItem!=null)
    lItem.Selected=true;
      

  3.   

    DropDownList1.DataBind();
    string type=dr["Texttype_id"].ToString();DropDownList1.SelectedIndex= this.DropDownList1.Items.IndexOf(DropDownList1.Items.FindByValue(type));
      

  4.   

    DropDownList1.SelectedIndex= this.DropDownList1.Items.IndexOf(DropDownList1.Items.FindByValue(你要找的值));DropDownList1.SelectedIndex= this.DropDownList1.Items.IndexOf(DropDownList1.Items.FindByText(显示的文本));