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:
<
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.