MarkFirstMatch telerik radcombobox仅在IE 11中过滤一个字符 [英] MarkFirstMatch telerik radcombobox filter one character ONLY in IE 11

查看:69
本文介绍了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中过滤一个字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆