Hi Gabriele,
Unfortunately I couldn't replicate the issue at my end. Please have a look into the following sample code snippet which works fine at my end and let me know if you have any concern.
ASPX:
<
telerik:RadComboBox
ID
=
"RadComboBox1"
runat
=
"server"
EnableLoadOnDemand
=
"true"
DataTextField
=
"Text"
DataValueField
=
"Value"
OnItemsRequested
=
"RadComboBox1_ItemsRequested"
>
</
telerik:RadComboBox
>
C#:
protected
void
RadComboBox1_ItemsRequested(
object
sender, Telerik.Web.UI.RadComboBoxItemsRequestedEventArgs e)
{
Telerik.Web.UI.RadComboBox combo = (Telerik.Web.UI.RadComboBox)sender;
String connstring = WebConfigurationManager.ConnectionStrings[
"NorthwindConnectionString"
].ConnectionString;
SqlConnection conn =
new
SqlConnection(connstring);
SqlDataAdapter adapter =
new
SqlDataAdapter();
adapter.SelectCommand =
new
SqlCommand(
"SELECT * from Customers WHERE CompanyName LIKE '"
+ e.Text +
"%'"
, conn);
DataTable data =
new
DataTable();
conn.Open();
try
{
adapter.Fill(data);
}
finally
{
conn.Close();
}
foreach
(DataRow row
in
data.Rows)
{
Telerik.Web.UI.RadComboBoxItem item =
new
Telerik.Web.UI.RadComboBoxItem(row[
"CompanyName"
].ToString());
combo.Items.Add(item);
}
}
Thanks,
Shinu.