Hi,
I need to show suggestios when user focues on control or deletes text completely but this is not working as expected. My custom filter function already retruns data properly for empty search strings.
This is my TextCahnged event implemtation:
private void usersAutoCompleteView_TextChanged(object sender, TextChangedEventArgs e)
{
var control = (RadAutoCompleteView)sender;
if (string.IsNullOrEmpty(e.NewTextValue) && !string.IsNullOrEmpty(e.OldTextValue))
{
control.ShowSuggestions();
}
}
And this is my Focused event implementation:
private void usersAutoCompleteView_Focused(object sender, FocusEventArgs e)
{
var control = (RadAutoCompleteView)sender;
if (string.IsNullOrEmpty(control.SearchText))
{
control.ShowSuggestions();
}
}
I am also using SuggestionItemSelected event but is really simple:
private void usersAutoCompleteView_SuggestionItemSelected(object sender, Telerik.XamarinForms.Input.AutoComplete.SuggestionItemSelectedEventArgs e)
{
MyUser = (e.DataItem as MyModel).User;
}
If I use Focused for showing Suggestions everything works fine, but when I added TextChanged nothings works as shoud:
1) Suggestion menu is never shown from TextChanged event
2) When I select Item from Suggsetion menu, text on the control gets immediately deleted (Text changed is getting called again with empty NewTextValue)
3) When I remove usage for TextChanged event misbehaviour is still there. I need to clean whole build/restart VS/emulator to get it running again.
How should I achieve this functionality? It should be simple, for me it's looks like a common scenario