I am relatively knew to the Telerik controls but have been a developer for several years. I want to implement a load on demand combo box for my newest project(well several really), the control will load from a page method. I got the control to load initially, but as you type the dropdown just bounces a little without narrowing the search or showing any type of error. Below is the code that is currently being used for the control, and page method.
private const int ItemsPerRequest = 20;
[WebMethod]
public static RadComboBoxData GetContributors(RadComboBoxContext context)
{
DataTable data = GetContributors();
RadComboBoxData comboData = new RadComboBoxData();
int itemOffset = context.NumberOfItems;
int endOffSet = Math.Min(itemOffset + ItemsPerRequest, data.Rows.Count);
comboData.EndOfItems = endOffSet == data.Rows.Count;
List<RadComboBoxItemData> results = new List<RadComboBoxItemData>(endOffSet - itemOffset);
for (int i = itemOffset; i < endOffSet; i++)
{
RadComboBoxItemData itemData = new RadComboBoxItemData();
itemData.Text = data.Rows[i]["Contributor"].ToString();
itemData.Value = data.Rows[i]["ContributorID"].ToString();
results.Add(itemData);
}
comboData.Message = GetStatusMessage(endOffSet, data.Rows.Count);
comboData.Items = results.ToArray();
return comboData;
}
{
if (total <= 0)
{
return "No matches";
}
else
{
return string.Format("Items <b>1</b>-<b>{0}</b> out of <b>{1}</b>", offSet, total);
}
}
<telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" Height="200px" Width="300px">
<telerik:RadComboBox ID="radcboAutoContributorNames" EmptyMessage="Please enter contributor name" Width="200px" MaxHeight="140px" EnableLoadOnDemand="true" ShowMoreResultsBox="true" EnableVirtualScrolling="true" Runat="server">
<WebServiceSettings Method="GetContributors" Path="Default.aspx" />
</telerik:RadComboBox>
</telerik:RadAjaxPanel>