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

TextBoxStyle does not allow the margin to be set

3 Answers 222 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Steve
Top achievements
Rank 1
Steve asked on 10 Jan 2020, 08:55 PM

I have an editable combobox, where I need the left margin increased. I found the TextBoxStyle property and tried to use it, but it does not work. To ensure that I was doing things correctly, I tried setting other properties, such as the background, which do work. So I know that my style is being applied, but your ComboBox code is overriding it somehow.

 

I've worked around the problem by finding the textbox by it's "PART_EditableTextBox" name and manually adjusting the margin, but it is not ideal on several levels. If I am doing something wrong, please let me know what I can do differently.

3 Answers, 1 is accepted

Sort by
0
Vladimir Stoyanov
Telerik team
answered on 15 Jan 2020, 11:36 AM

Hello Steve,

Thank you for the provided information. 

The "PART_EditableTextBox" element inside the ControlTemplate of the RadComboBox has its Margin set locally in some themes to correspond to the BorderThickness of the RadComboBox. 

With that information in mind, it is expected that the Margin set through the TextBoxStyle would not be taken into account (since the local value will take precendence). Can you share why setting the Margin on the "PART_EditableTextBox" element is not suitable for your scenario? 

Regards,
Vladimir Stoyanov
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
Steve
Top achievements
Rank 1
answered on 16 Jan 2020, 02:18 AM

The code is very convoluted to to wait until the template is applied, find the textbox and then fix it. I have it used a few places and they all sequence events differently as far as when things are loaded or applied, so I have to have multiple code paths to set the margin. Additionally, you can see it load in the wrong place and then shift over.

Really, what is the point of letting us set a style and not letting us actually set all of the properties. Why don't you put the properties in the style that is being overridden rather than local on the control?

0
Vladimir Stoyanov
Telerik team
answered on 20 Jan 2020, 12:52 PM

Hello Steve,

Thank you for your feedback.

I have discussed this scenario with our developers and we decided to log an item in our feedback portal for it: ComboBox: Setting the Margin through the TextBoxStyle is not respected. You can follow the feedback item in order to get notified for any developments. I have also added some telerik points to your account as a thank you for your involvement. 

Regards,
Vladimir Stoyanov
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
ComboBox
Asked by
Steve
Top achievements
Rank 1
Answers by
Vladimir Stoyanov
Telerik team
Steve
Top achievements
Rank 1
Share this question
or