This question is locked. New answers and comments are not allowed.
We want to provide our users with AutoCompletetion in a ComboBox. The problem is that the data source is containing alot of items, so we need to limit the suggestions based on what the user is writing.
So if the user enters Ab, we do a search in our database for entries starting with Ab and want to display those in the AutoComplete suggestor.
Here is our initial try to solve this:
private void radComboBox1_TextChanged(object sender, EventArgs e)
{
radComboBox1.Items.Clear();
foreach (string s in Accounts.Current.FindPartial(radComboBox1.Text))
radComboBox1.Items.Add(new RadComboBoxItem(s));
}
This seems to work ok as long as you keep typing, but once you start using arrow keys to select an item in the dropdown, we get an exception:
Index was out of range. Must be non-negative and less than the size of the collection.
(This happens in Telerik code inside radComboBox1.Items.Clear())
We then tried to use the KeyPress event instead, but this didn't help us, as the ComboBox text property isn't updated at this point, so we cannot do a proper search string.
Any idea how we can solve this problem?
So if the user enters Ab, we do a search in our database for entries starting with Ab and want to display those in the AutoComplete suggestor.
Here is our initial try to solve this:
private void radComboBox1_TextChanged(object sender, EventArgs e)
{
radComboBox1.Items.Clear();
foreach (string s in Accounts.Current.FindPartial(radComboBox1.Text))
radComboBox1.Items.Add(new RadComboBoxItem(s));
}
This seems to work ok as long as you keep typing, but once you start using arrow keys to select an item in the dropdown, we get an exception:
Index was out of range. Must be non-negative and less than the size of the collection.
(This happens in Telerik code inside radComboBox1.Items.Clear())
We then tried to use the KeyPress event instead, but this didn't help us, as the ComboBox text property isn't updated at this point, so we cannot do a proper search string.
Any idea how we can solve this problem?