高分求啊,高手快来得分了

解决方案 »

  1.   

    我在asp.net 下作,数据库用sqlserver
      

  2.   

    DataTable dt = new DataTable();
    this.DropDownList1.DataSource = dt.DefaultView;
    this.DropDownList1.DataTextField = "字段ID";
    this.DropDownList1.DataValueField = "字段ID";
    this.DropDownList1.DataBind(); 
      

  3.   

    这个dropdownlist能编辑么?比如我在下拉框中输入“中”,下面会出现以“中”开头的所有内容,
      

  4.   

    从数据库中选取数据,直接设置数据源,绑定就行了可编辑的话,大概类似combo      
                
           <script language="javascript">
    function catch_keydown(sel) { switch(event.keyCode) { case 13: //Enter; //sel.options[sel.length] = new Option("","",false,true); event.returnValue = false; break; case 27: //Esc; alert("text:" + sel.options[sel.selectedIndex].text + ", value:" + sel.options[sel.selectedIndex].value + ";"); event.returnValue = false; break; case 46: //Delete; //if(confirm("删除当前內容!?")) { sel.options[sel.selectedIndex] = null; if(sel.length>0) { sel.options[0].selected = true; } //} event.returnValue = false; break; case 8: //Back Space; var s = sel.options[sel.selectedIndex].text; sel.options[sel.selectedIndex].text = s.substr(0,s.length-1); event.returnValue = false; break; } } function catch_press(sel) { 
     if(event.keyCode!=13)
     {
    sel.options[sel.selectedIndex].text = sel.options[sel.selectedIndex].text + String.fromCharCode(event.keyCode); 
    sel.options[sel.selectedIndex].value = sel.options[sel.selectedIndex].text; }
    event.returnValue = false;
     } </script>
          
          
          
        
      

  5.   

    如果单使用dropdownlist实现楼主的方法,不是有难度,而是很有难度,变通的办法是有,但总感觉不是正宗.
    关注看谁有正宗的解决办法.
      

  6.   

    楼主的要求有难度,短时间估计不会有人给你答案的
    而且这个要求完全可以作为产品级的应用了(google的输入前提示)
      

  7.   

    you need make a custom composite control (dropdownlist + textbox or other editable controls)
      

  8.   

    下面的代码是我把数据库的信息绑定到下拉框中的。是直接粘过来的。好用。但不是三层结构。三层结构的类似。你要是需要我再发。
                SqlConnection sqlConn = new SqlConnection(SystemFramework.Common.getConnectionString());
                string commString = "select * from Products ";
                sqlConn.Open();
                SqlDataAdapter sda = new SqlDataAdapter(commString, sqlConn);
                DataSet ds = new DataSet();
                sda.Fill(ds, "names");
                comboBox1.DataSource = ds.Tables[0].DefaultView;
                comboBox1.DisplayMember = "Pro_Name";
                comboBox1.ValueMember = "Pro_ID";