Hello
We have a User Control (.Net, c#) that uses RadComboBox with MarkFirstCharacter=true and Filter="Contains".
When we started typing in the box, it would filter out using the characters as we type them.
It used to work in IE9 and IE10. But now with IE11, it has stopped working.
It only uses the first character. We can see that it has found all instances of items that use that character but as soon as we type the second character, it stops filtering. It works in Compatibility mode and also in Firefox.
Any ideas?
Thank you
Raka
We have a User Control (.Net, c#) that uses RadComboBox with MarkFirstCharacter=true and Filter="Contains".
When we started typing in the box, it would filter out using the characters as we type them.
It used to work in IE9 and IE10. But now with IE11, it has stopped working.
It only uses the first character. We can see that it has found all instances of items that use that character but as soon as we type the second character, it stops filtering. It works in Compatibility mode and also in Firefox.
Any ideas?
Thank you
Raka
4 Answers, 1 is accepted
0
Accepted
Princy
Top achievements
Rank 2
answered on 11 Jun 2014, 11:58 AM
Hi Raka,
Please have a look into the sample code snippet which works fine at my end.
ASCX:
ASPX:
Please provide your full code if it doesn't help.
Thanks,
Princy.
Please have a look into the sample code snippet which works fine at my end.
ASCX:
<
telerik:RadComboBox
ID
=
"RadComboBox1"
AllowCustomText
=
"true"
runat
=
"server"
Width
=
"300"
Filter
=
"Contains"
MarkFirstMatch
=
"true"
Height
=
"200px"
DataSourceID
=
"SqlDataSource1"
DataTextField
=
"ContactName"
EmptyMessage
=
"Search for people..."
Skin
=
"Office2010Silver"
>
</
telerik:RadComboBox
>
ASPX:
<
uc1:ComboBox
ID
=
"ComboBox1"
runat
=
"server"
/>
Please provide your full code if it doesn't help.
Thanks,
Princy.
0
Raka
Top achievements
Rank 1
answered on 11 Jun 2014, 12:36 PM
Hello Princy
Thank you for the quick reply.
It does not work when the UserControl containing the RadComboBox is contained inside another control.
So I have a UserControl1 with
<%@ Register src="UserControl2.asax" tagname="UserControl2" tagprefix="uc2" %>
...
<uc2:UserControl2 ID="rcbUC" runat="server" DefaultText="Choose one..." Width="250px" DropDownWidth="350px" MaxHeight="150px" IsRequired="true" />
...
UserControl2 has definition like --
<telerik:RadComboBox runat="server" ID="rcbRadComboBox" MaxHeight="300px" DropDownAutoWidth="Enabled" MarkFirstMatch="true" OnClientFocus="ShowDropDown"
Filter="Contains" OnItemDataBound="rcbRadComboBox_ItemDataBound" OnItemsRequested="rcbRadComboBox_ItemsRequested" OnSelectedIndexChanged="rcbRadComboBox_SelectedIndexChanged" />
This is where I have the problem. It does not work.
It may be something related to the UserControl - I don't know. But it used to work in IE9 and 10.
Thanks
Sandhia
Thank you for the quick reply.
It does not work when the UserControl containing the RadComboBox is contained inside another control.
So I have a UserControl1 with
<%@ Register src="UserControl2.asax" tagname="UserControl2" tagprefix="uc2" %>
...
<uc2:UserControl2 ID="rcbUC" runat="server" DefaultText="Choose one..." Width="250px" DropDownWidth="350px" MaxHeight="150px" IsRequired="true" />
...
UserControl2 has definition like --
<telerik:RadComboBox runat="server" ID="rcbRadComboBox" MaxHeight="300px" DropDownAutoWidth="Enabled" MarkFirstMatch="true" OnClientFocus="ShowDropDown"
Filter="Contains" OnItemDataBound="rcbRadComboBox_ItemDataBound" OnItemsRequested="rcbRadComboBox_ItemsRequested" OnSelectedIndexChanged="rcbRadComboBox_SelectedIndexChanged" />
This is where I have the problem. It does not work.
It may be something related to the UserControl - I don't know. But it used to work in IE9 and 10.
Thanks
Sandhia
0
Accepted
Princy
Top achievements
Rank 2
answered on 12 Jun 2014, 05:01 AM
Hi Raka,
Please try the sample code snippet snippet which works fine at my end. Please provide your full code if it doesn't help.
ASCX:
ASCX.CS:
Thanks,
Princy.
Please try the sample code snippet snippet which works fine at my end. Please provide your full code if it doesn't help.
ASCX:
<
telerik:RadComboBox
ID
=
"RadComboBox1"
runat
=
"server"
Width
=
"300"
EnableLoadOnDemand
=
"true"
MarkFirstMatch
=
"true"
Height
=
"200px"
EmptyMessage
=
"Search for people..."
Filter
=
"Contains"
Skin
=
"Office2010Silver"
OnItemsRequested
=
"RadComboBox1_ItemsRequested"
>
</
telerik:RadComboBox
>
ASCX.CS:
private
const
int
ItemsPerRequest = 10;
protected
void
RadComboBox1_ItemsRequested(
object
sender, Telerik.Web.UI.RadComboBoxItemsRequestedEventArgs e)
{
DataTable data = GetData(e.Text);
int
itemOffset = e.NumberOfItems;
int
endOffset = Math.Min(itemOffset + ItemsPerRequest, data.Rows.Count);
e.EndOfItems = endOffset == data.Rows.Count;
for
(
int
i = itemOffset; i < endOffset; i++)
{
RadComboBox1.Items.Add(
new
RadComboBoxItem(data.Rows[i][
"ContactName"
].ToString(), data.Rows[i][
"ContactName"
].ToString()));
}
}
private
static
DataTable GetData(
string
text)
{
SqlDataAdapter adapter =
new
SqlDataAdapter(
"SELECT ContactName from Customers WHERE ContactName LIKE @text + '%'"
,ConfigurationManager.ConnectionStrings[
"ConnectionString"
].ConnectionString);
adapter.SelectCommand.Parameters.AddWithValue(
"@text"
, text);
DataTable data =
new
DataTable();
adapter.Fill(data);
return
data;
}
Thanks,
Princy.
0
Raka
Top achievements
Rank 1
answered on 12 Jun 2014, 01:48 PM
Great! Thank you very much. I was missing "EnableLoadOnDemand='true'" property.
Appreciate it much.
Raka.
Appreciate it much.
Raka.