如何设置COMBOBOX中的SELECTVALUE的值?

解决方案 »

  1.   

    string duration=ds.Tables[0].Rows[0]["druation"].ToString();//从数据库读取到的值
    try{drpDuration.Items.FindByValue(duration.ToString()).Selected=true;}
    catch{}
      

  2.   

    和数据库绑定的方法,如下,这我到知道了。
    cbxReport.DataSource=datatable;
    cbxReport.DisplayMember="ReportName";
    cbxReport.ValueMember="ReportID";有没有办法,通过这样加入的项,可以选择值?
    cbxReport.Items.Add(row["ReportID"]);
      

  3.   

    这样的话
    自己重写一个ComboBox控件
    网上好像见到过
      

  4.   

    难道SELECTVALUE中的值是没有办法写入的吗?不可能吧?