MarkFirstMatch telerik radcombobox仅在IE 11中过滤一个字符

编程入门 行业动态 更新时间:2024-10-26 21:23:07
本文介绍了MarkFirstMatch telerik radcombobox仅在IE 11中过滤一个字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

你好, 我对RadComboBox有严重问题 过滤RadComboBox IE 9时,它实际上与markfirstmatch属性工作正常,我可以使用多个字符过滤 例如,如果我过滤Combobox找到名为AmrRafat的项目,我可以写'amr'和组合框将完成剩下的工作并找到这个项目。 但是当在IE 11中尝试相同的场景时,它只接受第一个字符,每次我按一个键它将其视为过滤的第一个字符 例如,如果我过滤Combobox以查找名称为AmrRafat的项目,并且我尝试编写'amr'然后Combobox将只假设一个字符和过滤器它是 .aspx文件

< telerik:RadComboBox ID = cmbPayers runat = server 宽度 = 100% AutoPostBack = true MarkFirstMatch = true TabIndex = 11 OnSelectedIndexChanged = cmbPayers_SelectedIndexChanged > < / telerik:RadComboBox >

任何想法? IT的紧急!!! !

解决方案

首先删除标记并在要求的项目上添加此代码 protected void cmbemp_ItemsRequested(object sender,RadComboBoxItemsRequestedEventArgs e) { string s = System.Configuration.ConfigurationManager.AppSettings [DataCon]。ToString(); 试试 { string sqlSelectCommand =SELECT emp_id,emp_name FROM tblemployes其中m.emp_name LIKE @text +'% 'ORDER BY m.emp_name; SqlDataAdapter adapter = new SqlDataAdapter(sqlSelectCommand,s); adapter.SelectCommand.Parameters.AddWithValue(@ text,e.Text); DataTable dataTable = new DataTable (); adapter.Fill(dataTable); foreach(DataTable.Rows中的DataRow dataRow) { RadComboBoxItem item = new RadComboBoxItem(); item.Text =(string)dataRow [emp_name]; item。 Value = dataRow [emp_id]。ToString(); id = Convert.ToString(dataRow [emp_id]); // string status = Convert.ToString(dataRow [emp_Status]); item.Attributes.Add(emp_id,id); // item.Attributes.Add(emp_Status,status); cmbemp.Items.Add(ite m); cmbemp.DataBind(); } } catch(Exception ex) { 抛出新的ApplicationException(ex.Message); } }

Hello, I've a serious problem with RadComboBox When Filtering RadComboBox IE 9 , it works fine actually with markfirstmatch property and i could filter with more than one character For example if i am filtering Combobox to find item with name "AmrRafat", i could write 'amr' and the combobox will do the rest and finds this item. but when trying the same scenario in IE 11, it only accepts the first character and each time i am pressing a key it consider it as the first character for filtering For example if i am filtering Combobox to find item with name "AmrRafat", and i tried to write 'amr' Then Combobox will assume only one character and filter with it .aspx File

<telerik:RadComboBox ID="cmbPayers" runat="server" Width="100%" AutoPostBack="true" MarkFirstMatch="true" TabIndex="11" OnSelectedIndexChanged="cmbPayers_SelectedIndexChanged"></telerik:RadComboBox>

Any Ideas? IT's URGENT !!!!

解决方案

remove mark as first and add this code on Item Requested protected void cmbemp_ItemsRequested(object sender, RadComboBoxItemsRequestedEventArgs e) { string s = System.Configuration.ConfigurationManager.AppSettings["DataCon"].ToString(); try { string sqlSelectCommand = "SELECT emp_id,emp_name FROM tblemployes Where m.emp_name LIKE @text + '%' ORDER BY m.emp_name "; SqlDataAdapter adapter = new SqlDataAdapter(sqlSelectCommand, s); adapter.SelectCommand.Parameters.AddWithValue("@text", e.Text); DataTable dataTable = new DataTable(); adapter.Fill(dataTable); foreach (DataRow dataRow in dataTable.Rows) { RadComboBoxItem item = new RadComboBoxItem(); item.Text = (string)dataRow["emp_name"]; item.Value = dataRow["emp_id"].ToString(); id = Convert.ToString(dataRow["emp_id"]); //string status = Convert.ToString(dataRow["emp_Status"]); item.Attributes.Add("emp_id", id); // item.Attributes.Add("emp_Status", status); cmbemp.Items.Add(item); cmbemp.DataBind(); } } catch (Exception ex) { throw new ApplicationException(ex.Message); } }

更多推荐

MarkFirstMatch telerik radcombobox仅在IE 11中过滤一个字符

本文发布于:2023-11-23 03:55:10,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1619998.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:字符   telerik   MarkFirstMatch   radcombobox

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!