RadDateTimePicker - Prevent TABStop

1 Answer 50 Views
DateTimePicker
Mark
Top achievements
Rank 2
Bronze
Iron
Veteran
Mark asked on 03 Aug 2023, 07:34 PM

I want to prevent the radDateTimePicker from getting focus with TabStop set to FALSE and the control is enabled. I can do this with TextBoxes and CheckBox, etc, but this control, no matter what I do, even if I set the internal controls to TabStop = false, the control still gets focus.  

 

Looking for a solution

TIA

 

1 Answer, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 08 Aug 2023, 05:56 AM

Hello, 

Please have in mind that RadDateTimePicker internally hosts the standard MS TextBox which actually gets the focus. If you want to skip focusing the RadDateTimePicker control, it is necessary to set the TabStop property to false for the hosted textbox:

            this.radDateTimePicker1.DateTimePickerElement.TextBoxElement.TextBoxItem.TabStop = false;

I hope this information helps. If you need any further assistance please don't hesitate to contact me. 

Regards,
Dess | Tech Support Engineer, Principal
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Mark
Top achievements
Rank 2
Bronze
Iron
Veteran
commented on 08 Aug 2023, 10:32 AM

Yea, I thought I was already doign that, let me look further.
Dess | Tech Support Engineer, Principal
Telerik team
commented on 10 Aug 2023, 09:05 AM

Hi, Mark, Take as much time as you need for further testing. Let me know if you have any difficulties.
Mark
Top achievements
Rank 2
Bronze
Iron
Veteran
commented on 10 Aug 2023, 10:47 AM

Sorry, busy work got in the way.  

 

What I don't understand, is why, with all your controls, do we, as developers, have to go through all these steps.  Why are these controls inside a control automatically set based on the main control.  It's really fustrating to have to go through this step for every control.  Yes, I know we can subclass this, but really

So, you are right, I have to put CODE in the code-behind to do this. Using the EDIT UI ELEMENTS, the TextBoxElement is not visible.  Here is what we get, and even setting what I have nighlights, still doesn't work. I am required to, in code, to set as you outlined above.  

 

 

Dess | Tech Support Engineer, Principal
Telerik team
commented on 14 Aug 2023, 09:24 AM

Hi, Mark,

The provided feedback is greatly appreciated.

I agree with you that it is frustrating to iterate all the controls and set the DateTimePickerElement.TextBoxElement.TextBoxItem.TabStop property to false for the nested MS TextBox. Most of our editors, e.g. RadTextBox, RadDateTimePicker, RadDropDownList, internally use the standard MS TextBox. Even though we have our own RadTextBoxControl, there are still some differences in the internal implementation and the supported features, like right-to-left support:

https://docs.telerik.com/devtools/winforms/controls/editors/textboxcontrol/radtextboxcontrol-vs-radtextbox 

As to the Edit UI Elements option, the RadTextBoxItem.TabStop property is not serialized in the Designer.cs file. That is why after closing the designer and reopening it again,  the value is not stored to the previously set value. As you have already found out, it should be set programmatically as demonstrated in my previous reply. 

Tags
DateTimePicker
Asked by
Mark
Top achievements
Rank 2
Bronze
Iron
Veteran
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or