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

VirtualKeyboardForm does not open at associated control

2 Answers 129 Views
VirtualKeyboard
This is a migrated thread and some comments may be shown as answers.
Tobias
Top achievements
Rank 1
Tobias asked on 05 Mar 2020, 02:59 PM

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 Answers, 1 is accepted

Sort by
0
Tobias
Top achievements
Rank 1
answered on 05 Mar 2020, 03:00 PM

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; }
    }
}
0
Dimitar
Telerik team
answered on 09 Mar 2020, 12:36 PM

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.
Tags
VirtualKeyboard
Asked by
Tobias
Top achievements
Rank 1
Answers by
Tobias
Top achievements
Rank 1
Dimitar
Telerik team
Share this question
or