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

ComboBox width not matching other elements.

1 Answer 161 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Satish
Top achievements
Rank 1
Satish asked on 25 Apr 2012, 04:03 PM
I'm trying to set the width of controls in my form but I noticed that the combobox tends to be a little shorter than the other elements with the same width.
Here is a sample http://jsfiddle.net/sitty/PLdGS/8/ I have one input text control and another kendo ComboBox both with width set to 300 but the combo box appears to be a little shorter than the input control.

1 Answer, 1 is accepted

Sort by
0
Iliana Dyankova
Telerik team
answered on 01 May 2012, 11:04 AM
Hi Satish,

The reason for such behavior is that Kendo UI ComboBox width includes content+padding+border, but the HTML textbox default width includes only the content. In order to achieve the same styling for this two components you could try different approaches, depending on your application details. For example - set width of the textbox reduced with the border size.
$("#test").width(298);

Another example solution is to subtract the border width of the Kendo UI ComboBox from the width of the textbox using JavaScript. For convenience I updated your jsFiddle example. 

Regards,
Iliana Nikolova
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
ComboBox
Asked by
Satish
Top achievements
Rank 1
Answers by
Iliana Dyankova
Telerik team
Share this question
or