[AjaxMethod()] public ArrayList GetSearchItems(string strQuery) { string con = ConfigurationManager.ConnectionStrings["SQLServerConnectionString"].ConnectionString; SqlDataAdapter sda = new SqlDataAdapter("select distinct expand6 from wiscommon.dbo.ifs_userwell where userid=" + base.GetUserId() + "; ", con); DataSet ds = new DataSet(); sda.Fill(ds); //生成数据源 ArrayList items = new ArrayList(); for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { string cname = ds.Tables[0].Rows[i]["expand6"].ToString(); items.Add(cname); } //筛选数据 ArrayList selectItems = new ArrayList(); foreach (string str in items) { if (str.ToUpper().IndexOf(strQuery.ToUpper()) == 0) { selectItems.Add(str); } } return selectItems; }
绑定,筛选,都有,,问题是,红色的区域,,,,假如上面items里面有5条数据,分别是...xyz,xzz,yzz,yaa,tcc...5条,我下面筛选数据,现在实现的是,当输入x时....yzz,yaa,tcc不显示了,想要做成,5条数据都显示,当输入x时,xyz,xzz,变颜色,有大神在吗?在线等...解决了加分噢!
- 1 回答
- 0 关注
- 280 浏览
添加回答
举报
0/150
提交
取消