请教一下是怎么实现的 通过在一个textbox中输入内容 下拉框中显示有这些内容的数据 要和数据库连接的 以前接触过 是不是要用ajax的
对的需要用ajax,叫autocomplete有很多这种插件的
具体怎么 弄的额 求帮助
@青空下的思念: 简单的就用jquery,有一个插件
http://jqueryui.com/autocomplete/ 官网
http://www.cnblogs.com/hyl8218/archive/2010/03/19/1688828.html
@FightingMy: 谢谢~
我前两天刚做了一个类似的,就是通过ajax实现的,文本框中添加KeyUp事件,输入内容也就是按下键盘按键KeyUp之后触发事件,进行模糊查询显示数据的,然后点选实现选择。
。有具体的代码没 。对ajax这方面不太熟悉额
后台方法返回数据,利用ajax绑定到TextBox中
具体怎么弄得 求帮助
http://www.cnblogs.com/humble/p/3415506.html
支持mysql mssql sqlite
DataTable dtChezhong = DBM.GetDataSet("select distinct(Chezhong) from Pinfan"); string[] arrayA = new string[dtChezhong.Rows.Count]; int k = 0; foreach (DataRow dr in dtChezhong.Rows) { arrayA[k] = dr["Chezhong"].ToString(); k++; } txtChezhong.AutoCompleteCustomSource.AddRange(arrayA); txtChezhong.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend; txtChezhong.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource;
我经常在winform中用这个功能,代码请参考。
有没有网页 的 - - 没用winform做 不过还是谢谢了