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

2 posts, 0 answers
  1. Bill
    Bill avatar
    33 posts
    Member since:
    Nov 2017

    Posted 16 May 2018 Link to this post

    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?
  2. Didi
    Didi avatar
    283 posts

    Posted 18 May 2018 Link to this post

    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

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

    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
Back to Top