Hi!
I'm trying to realize some kind of article search in form of a text- or combobox. When the user enters some text, the autocompletion should perform a fulltext search for any matching article.
The actual autocompletion only works like the string.StartsWith(...) function but I'd like to have something like the string.Contains(...) function.
I tried to ralize it with a combobox that changes its ItemCollection on the TextChanged event:
This work to the point where the user uses the arrow keys to navigate through the autocomplete list. This leads to an update and only one remaining option in the autocomplete list.
Any suggestions? Is there a property for the autocomplete functionality I don't know?
kind regards,
Thomy
I'm trying to realize some kind of article search in form of a text- or combobox. When the user enters some text, the autocompletion should perform a fulltext search for any matching article.
The actual autocompletion only works like the string.StartsWith(...) function but I'd like to have something like the string.Contains(...) function.
I tried to ralize it with a combobox that changes its ItemCollection on the TextChanged event:
private
void radComboBox1_TextChanged(object sender, EventArgs e)
{ var query = from s in _autoComplete.Keys |
where s.Contains(radComboBox1.Text) |
select s; |
radComboBox1.BeginUpdate(); |
radComboBox1.Items.Clear(); |
foreach (string art in query.ToArray()) |
{ |
radComboBox1.Items.Add(new RadComboBoxItem() { Text = art, Tag = _autoComplete[art] }); |
} |
radComboBox1.EndUpdate(); |
radComboBox1.ShowDropDown(); } |
This work to the point where the user uses the arrow keys to navigate through the autocomplete list. This leads to an update and only one remaining option in the autocomplete list.
Any suggestions? Is there a property for the autocomplete functionality I don't know?
kind regards,
Thomy