Hi all,
I am very new to Xamarin.Forms and the Syncfusion controls.
I implemented two views with the autocomplete controls
When the view pops I am raising the Focus() event on the autocomplete control in OnAppearing. This raises the keyboard. Perfect.
protected override void OnAppearing()
{
autocomplete.Focus();
}
However I also have a SAVE button which will save the selected text. I then want to clear the autocomplete and raise the focus event again.
The control does not receive the focus and no keyboard pops up.
I also implemented a custom renderer on the 2nd form, as I wanted the numeric keyboard only. Same problem with the focus on the 2nd time.
btnSave.Pressed += (sender, e) =>
{
String r = (String)autocomplete.SelectedItem;
if (String.IsNullOrEmpty(r))
{
lblResult.Text = "No result";
lblResult.BackgroundColor = Color.Red;
autocomplete.Text = String.Empty; // or autocomplete.Clear(), no difference
autocomplete.Focus();
}
else {
lblResult.Text = (String)autocomplete.SelectedItem;
lblResult.BackgroundColor = Color.Green;
autocomplete.Text = String.Empty;
autocomplete.Focus();
}
};
Does anyone have a clue?
All the best from Germany
Marcus