DropDownList.Items.FindText("河北").Selected = true;
//但是在这之前一定要判断DropDownList.Items.FindText("河北")是否存在!

解决方案 »

  1.   

    DropDownList.Items["河北"].Selected=true;
      

  2.   

    dropdownlist.Items.FindByText("山东").Selected = true;
      

  3.   

    1.得判断有否有该值,否则将出错
    dropdownlist.Items.FindByText("山东").Selected = true;
    2.
    void GetSeleIndex(DropDownList ddl,string sValues)
    {
    for(int i=0;i<ddl.Items.Count;i++)
    {
    if (ddl.Items[i].Value==sValues)
    {
    ddl.SelectedIndex=i;
    return;
    }
    }
    }
      

  4.   

    try
    {
        dropdownlist.Items.FindByText("河北").Selected = true;
    }
    catch(Exception ex)//如果不包含Text为河北的项会出现异常,在这里捕获。
    {
        dropdownlist.Items[0].Selected=true;//如不包含河北项,选则第一项。
    }
      

  5.   

    也可以通过FindByValue()来实现,如果各个item中都有value值的话。方法同hq1305018(跃强) 。
      

  6.   

    try
    {
        dropdownlist.Items.FindByText("河北").Selected = true;
    }
    catch(Exception ex)//如果不包含Text为河北的项会出现异常,在这里捕获。
    {
        dropdownlist.Items[0].Selected=true;//如不包含河北项,选则第一项。
    }
    如上所说