<telerik:RadComboBox ID="RadComboBox1" runat="server" Width="250px" Height="150px"
EmptyMessage="Select a Company" EnableLoadOnDemand="True" ShowMoreResultsBox="true"
EnableVirtualScrolling="true" OnItemsRequested="RadComboBox1_ItemsRequested">
</telerik:RadComboBox>
protected void RadComboBox1_ItemsRequested(object sender, 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]["CompanyName"].ToString(), data.Rows[i]["CompanyName"].ToString()));
}
e.Message = GetStatusMessage(endOffset, data.Rows.Count);
}
This combobox is going to appear on an edit page, and I need to set the default selected value when the page loads. How do I do that?
My problem is very similar to this: http://www.telerik.com/community/forums/aspnet-ajax/combobox/selectedvalue-and-loadondemand.aspx
The control is in a FormView, but the control is attempting to bind when the page loads and the RadComboBox1_ItemsRequested event has not fired. If I am only pulling back a subset of records, how does it no to get the item that matches the existing value?