15 Answers, 1 is accepted
Thank you for contacting Telerik Support.
We already have this issue logged in our Public Issue Tracking System, you can find it on the following address - http://www.telerik.com/support/pits.aspx#/details/Issue=16073 where you can vote/comment or subscribe for changes.
As a workaround you can set the TabStop property of the hosted TextBoxControl:
this
.radDropDownList1.DropDownListElement.TextBox.TextBoxItem.TextBoxControl.TabStop =
false
;
I hope this helps.
Regards,
George
Telerik
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Your above solution works when DropDownStyle = RadDropDownStyle.DropDown
However it does not work when DropDownStyle = RadDropDownStyle.DropDownList
Can you please provide the workaround line for when the DropDownStyle = RadDropDownStyle.DropDownList
Thanks.
Thank you for writing.
You do not need a workaround in the case where the DropDownStyle is set to DropDownList. You can simply set the TabStop property to the RadDropDownList:
ddlist.DropDownStyle = RadDropDownStyle.DropDownList;
ddlist.TabStop =
false
;
Let me know, if you have further questions.
Regards,
George
Telerik
George,
I am currently using the WinForms release 2015.1.331.40.
Frorm your previous posted example it is defaulting to True which is what I was expecting this.radDropDownList1.DropDownListElement.TextBox.TextBoxItem.TextBoxControl.TabStop
But I want to be able to set the tab stop to true but when I try to set the TabStop = True, it never changes from False to true
Here is my code example
RadDropDownList ddl = new RadDropDownList();
ddl.Name = fld.Name;
ddl.Tag = fld.UniqueName;
ddl.Dock = DockStyle.None;
ddl.Width = 350;
ddl.NullText = fld.Alias;
ddl.DropDownSizingMode = SizingMode.UpDownAndRightBottom;
ddl.DropDownStyle = RadDropDownStyle.DropDown;
ddl.TabStop = true; // Always stays false, never changes to true
I can use the workaround for now, but I will need to possibly use the DropDownList style in the future and the TabStop is functioning the same way.
Thanks,
Martin
Thank you for writing back.
Yes, this property value is hard-coded to false. The case here is that our editors (RadDropDownList, RadDateTimePicker, RadTimePicker and RadMaskedEditBox) internally host the standard MS TextBox control. So, in order to allow the inner text box control to get the focus, we have hardcoded the control TabStop property to false, so the inner control will accept the focus (and you will be able to type in after pressing tab). At the same time, the DefaultValue attribute of the TabStop property is true, so when we hard coded it to false, once you opened a form designer containing these controls, their TabStop property will get serialized to false and you will not be able to change that. However, in general, you shouldn't need to change that by default, as the focus will be given to the inner control as it should. If you want to disable the TabStop you can set it to false in code (this will set the TabStop of the internal textbox):
radDropDownList1.TabStop =
false
;
I hope this information helps.
Regards,
Dimitar
Telerik
See What's Next in App Development. Register for TelerikNEXT.
Hello Dimitar...
I have tried to encapsulate the radDropDownList class into MyDDLClass, then shadow the TabStop property so the getter and setter method makes use of Me.DropDownListElement.EditableElement.TextBox.TextBoxItem.TextBoxControl.TabStop
but it still won't work even though i set this to true in the designer. The only way I can make it work, is by removing my property and by code set the property to true manually....
This is my derived class with tabstop working
public abstract class QComboBoxBase : RadDropDownList
{
protected QComboBoxBase()
{
// zet dropdownlist gedrag
DropDownStyle = RadDropDownStyle.DropDown;
AutoCompleteMode = AutoCompleteMode.SuggestAppend;
DropDownListElement.AutoCompleteAppend.LimitToList = true;
DropDownListElement.TextBox.TextBoxItem.TextBoxControl.TabStop = true;
if (LicenseManager.UsageMode != LicenseUsageMode.Designtime)
{
QLoadData();
}
}
public override string ThemeClassName
{
get { return typeof(RadDropDownList).FullName; }
}
protected override void OnLoad(Size desiredSize)
{
base.OnLoad(desiredSize);
}
//protected override void InitLayout()
//{
// base.InitLayout();
// if (!IsDesignMode)
// {
// QLoadData();
// }
//}
protected abstract void QLoadData();
}
Yes, and this does not work for me. My class looks like this (It is vb.NET, but I hope you will manage):
Public Sub New()
MyBase.New()
Me.DropDownListElement.EditableElement.TextBox.TextBoxItem.TextBoxControl.TabStop = True
End Sub
Public Shadows Property TabStop As Boolean
Get
Return Me.DropDownListElement.EditableElement.TextBox.TextBoxItem.TextBoxControl.TabStop
End Get
Set(value As Boolean)
Me.DropDownListElement.EditableElement.TextBox.TextBoxItem.TextBoxControl.TabStop = value
End Set
End Property
The property was to make it accessible through the designer, but none of this works...
This is not exactly the same.
DropDownListElement.TextBox.TextBoxItem.TextBoxControl.TabStop = true;
I do not have 'EditableElement' in my line
You are correct...
Changed my code and it still doesn't work. I can set it to true in the designer, but when I clean and rebuild, the value is reset to false... So still no luck unfortunately
Thank you for writing.
The class should look like this:
Friend
Class
MyRadDropDwonList
Inherits
RadDropDownList
Public
Sub
New
()
Me
.DropDownStyle = Telerik.WinControls.RadDropDownStyle.DropDown
Me
.DropDownListElement.TextBox.TextBoxItem.TextBoxControl.TabStop =
True
End
Sub
Public
Shadows
Property
TabStop()
As
Boolean
Get
Return
Me
.DropDownListElement.TextBox.TextBoxItem.TextBoxControl.TabStop
End
Get
Set
(
ByVal
value
As
Boolean
)
Me
.DropDownListElement.TextBox.TextBoxItem.TextBoxControl.TabStop = value
End
Set
End
Property
End
Class
The important part is that the drop down style must be set before the TabStop, setting it after that will reset the TabStop.
Let me know if you have additional questions.
Regards,
Dimitar
Telerik
First of all, hans, thanks for your help
Thanks Dimitar. That was what was doing it. Is there any way I could have known this by looking in the documentation or anything? Sometimes these underlaying resets of properties can really pull some hair out :)
Regards Michael
Thank you for writing back.
I agree with you, and I believe that setting the drop down style should not reset the TabStop. This is why I have logged this case in our Feedback Portal. This will allow our developers to fully investigate this and determine why this reset is necessary. You can track the item for status changes and add your vote for it here.
Should you have any other questions do not hesitate to ask.
Regards,
Dimitar
Telerik
Thank you for writing.
May I ask you to share which property page are you referencing so that I can take a closer look?
Missing TabStop from the Designer Property page
Thank you for elaborating on your question.
As my colleague, Dimitar mentioned in one of his previous replies, the RadDropDownList control internally hosts the MS TextBox. The RadDropDownList control should not capture the focus but the inner MS TextBox control should. That is why this property was hidden from the property's window.