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

ButtonTextBox Keyboard handling / Button Selection

5 Answers 22 Views
TextBox
This is a migrated thread and some comments may be shown as answers.
erwin
Top achievements
Rank 1
Veteran
erwin asked on 27 Jun 2019, 09:36 AM

How can I select the Button(s) via Keyboard. Tab does not seem to work while inside the Textbox.

Regards

Erwin

5 Answers, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 28 Jun 2019, 09:21 AM
Hi Erwin,

The buttons inside the textbox cannot be focused because they are part of the textbox and are not separate controls. What I can suggest is adding shortcuts to them. For example:
this.radButtonElement1.Shortcuts.Add(new RadShortcut(Keys.Control, Keys.N));

Another approach would be to add button control to the textbox using host item: Use Control inside an Element.

I hope this helps. Should you have any other questions, do not hesitate to ask.

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.
0
erwin
Top achievements
Rank 1
Veteran
answered on 28 Jun 2019, 09:45 AM

Thanks Dimitar,

maybe I should put my Question in another way: How is default keyboard navigation within a ButtonTextBox supposed to work.

Regards

Erwin

 

0
Dimitar
Telerik team
answered on 28 Jun 2019, 11:54 AM
Hello Erwin,

The RadButtonTextBox should act exactly like the standard text box and the tab key should move the focus to the next control on the form. The items inside the textbox cannot gain the focus because they are not controls, they are RadElements which are intended to be nested inside a single control. If you want to customize this behavior please use one of the approaches from my previous post. 

Should you have further questions, I would be glad to help.

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.
0
erwin
Top achievements
Rank 1
Veteran
answered on 28 Jun 2019, 12:44 PM

So in other words, the ButtonTextBox control does not support keyboard navigation within its components (the text input area and the various buttons) out of the box? That would IMHO be a serious flaw in a text oriented control.

I do like the idea of combining a textbox and one or more buttons, especially as that promises to takes away the problems with layout in high dpi, resizable dialogs, anchoring etc. Probably I could come up with some derived user control that does implement some form of keyboard support, but support out of the box would be nice.

Regards Erwin

0
Dimitar
Telerik team
answered on 01 Jul 2019, 06:34 AM
Hi Erwin,

Thank you for your feedback, we will consider implementing this if we receive more request for it. 

Please note that using the host item is fairly simple solution. Here is how you can add a button that will be respected by the tab order:
public RadForm1()
{
    InitializeComponent();
 
    var button = new RadButton();
    button.Text = "test";
 
    RadHostItem item = new RadHostItem(button);
    item.MinSize = new Size(50, 20);
    radButtonTextBox1.RightButtonItems.Add(item);
 
}

Please let me know if there is something else I can help you with. 
 
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
TextBox
Asked by
erwin
Top achievements
Rank 1
Veteran
Answers by
Dimitar
Telerik team
erwin
Top achievements
Rank 1
Veteran
Share this question
or