This is a migrated thread and some comments may be shown as answers.

How to make keyboard appear when Focus() is called?

1 Answer 1476 Views
Entry
This is a migrated thread and some comments may be shown as answers.
Bill
Top achievements
Rank 1
Bill asked on 16 May 2018, 02:55 PM
As per title - is this possible? Setting Focus() in code only puts the cursor in the control, the keyboard only appears when you actually touch it. Also, if it's possibleto make the keyboard appear, is it possible to either automatically select all the text in the control, or position to caret at a specific point?

1 Answer, 1 is accepted

Sort by
1
Didi
Telerik team
answered on 18 May 2018, 12:49 PM
Hi Bill,

Indeed, calling Focus() method for RadEntry only focuses the input part of the control. In order to make the keyboard visible and select the text, you will need to implement it in separate custom renderers for each platform.

I have prepared a sample example with all changes that needs to be done. I created MyEntryRenderer.cs file for iOS and UWP platforms and EntryRenderer.cs file for Android platform with all required methods for making keyboard visible and selecting the text. In the Portable project inside MyEntry.cs file, MyEntry inherits from RadEntry.

For more details on implementing custom renderers please refer to the Xamarin.Forms documentation https://docs.microsoft.com/en-us/xamarin/xamarin-forms/app-fundamentals/custom-renderer/entry

I am staying in touch for any further questions I could be of help with.

Regards,
Didi
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Entry
Asked by
Bill
Top achievements
Rank 1
Answers by
Didi
Telerik team
Share this question
or