VirtualKeyboardForm does not open at associated control

3 posts, 0 answers
  1. Tobias
    Tobias avatar
    7 posts
    Member since:
    Jun 2015

    Posted 05 Mar 2020 Link to this post

    First of all I really like the new VirtualKeyboard and it is doing a good job so far.

    Nethertheless I've found an issue that the keyboard is not opening below the associated control the first time it is shown.
    After closing and reopening the keyboard it is on the correct position. This behaviour only occurs on the right half of the screen.

    Is this a bug or am I doing anything wrong?

    Attached you can find a sample project.

  2. Tobias
    Tobias avatar
    7 posts
    Member since:
    Jun 2015

    Posted 05 Mar 2020 in reply to Tobias Link to this post

    Sorry, here is the code of the sample application.

     

    public partial class RadForm1 : Telerik.WinControls.UI.RadForm
    {
        private List<TestData> mData;
     
        public RadForm1()
        {
            InitializeComponent();
     
            mData = new List<TestData>()
            {
                new TestData()
                {
                     EditValue = "5",
                     ReadOnlyValue = "Entry 1"
                },
                new TestData()
                {
                    EditValue = "3",
                     ReadOnlyValue = "Entry 2"
                }
            };
     
            radGridView1.AutoGenerateColumns = true;
            radGridView1.AllowEditRow = true;
            radGridView1.CellEditorInitialized += radGridView1_CellEditorInitialized;
     
            radGridView1.DataSource = mData;
            radGridView1.Columns[1].ReadOnly = false;
     
            radVirtualKeyboardForm1.KeyboardForm.VirtualKeyboard.LayoutType = KeyboardLayoutType.Numpad;
        }
     
        private void radGridView1_CellEditorInitialized(object sender, GridViewCellEventArgs e)
        {
            if (e.ActiveEditor is RadTextBoxEditor editor)
            {
                RadTextBoxEditorElement element = editor.EditorElement as RadTextBoxEditorElement;
                radVirtualKeyboardForm1.SetAssociatedKeyboardType(element.TextBoxItem.HostedControl, AssociatedKeyboardType.AssociatedControl);
            }
        }
     
        public class TestData
        {
            public string ReadOnlyValue { get; set; }
            public string EditValue { get; set; }
        }
    }
  3. Dimitar
    Admin
    Dimitar avatar
    24 posts

    Posted 09 Mar 2020 Link to this post

    Hello Tobias,

    Based on your information and provided code snipped I have reproduced the scenario that you described. I agree that if RadVirtualKeyboardForm.OpenUnderAssociatedControl property is set, the keyboard should open under the control even if it is near the edge of the screen.

    I have logged a new item in our feedback portal. You can track its progress, subscribe for status changes and add your comments on the following link - RadVirtualKeyboard: KeyboardForm does not open under its associated control if the LayoutType is set to Numpad

    I have also updated your Telerik points

    As a workaround you can set the size of KeyboardForm right after specifying the KeyboardLayoutType:

    radVirtualKeyboardForm1.KeyboardForm.VirtualKeyboard.LayoutType = KeyboardLayoutType.Numpad;
    this.radVirtualKeyboardForm1.KeyboardForm.Size = this.radVirtualKeyboardForm1.KeyboardForm.VirtualKeyboard.CalculateDesiredSize().ToSize();
    

    Please don't hesitate to ask if you have further questions.

    Regards,
    Dimitar
    Progress Telerik

    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Back to Top