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

Can I change the width of the dropdown list?

6 Answers 1308 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Anderson
Top achievements
Rank 1
Anderson asked on 13 Apr 2011, 07:38 PM
how can I change the height of the dropdown list and combobox?
I already had tried to change the style on the combobox method DropDownHtmlAttributes, writing something like this:

.DropDownHtmlAttributes( new { style = "width = 150px; font-size: 10px; height: 70px;" } )

but it takes no effects...
there is another way to change the height ????

6 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 14 Apr 2011, 07:04 AM
Hello Anderson,

 Why are you setting width using = and height using ":" ? Both should be using ":".

.DropDownHtmlAttributes( new { style = "width:150px; font-size: 10px; height: 70px;" } )

Regards,
Atanas Korchev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Anderson
Top achievements
Rank 1
answered on 14 Apr 2011, 02:02 PM
oh my!!!

I typed wrong in the example!!!
ahahahhahah

but, even with the " : " instead " = " it takes no effect yet...

in the generated html, the height is setted as "auto", but in the width, it's setted
with the value I passed...
0
Dimo
Telerik team
answered on 15 Apr 2011, 09:00 AM
Hi Anderson,

The specified dropdown height is ignored if there are less than 10 items. I suppose you are making tests with very few items and this causes the problem. If you add more items, you will get the expected result. Otherwise, is the height really necessary?

Kind regards,
Dimo
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Anderson
Top achievements
Rank 1
answered on 15 Apr 2011, 01:51 PM
hum...

well... there's really less than 10 items...
and yes, it's really necessary because the combobox is in a iframe inside a modal window and almost in the bottom of the window...

=(

there's some workaround for this???
0
Dimo
Telerik team
answered on 15 Apr 2011, 02:17 PM
Hello Anderson,

Yes, you can use a custom CSS class and a CSS rule:

<%= Html.Telerik().DropDownList().Name("DropDownList1")
    .Items(items =>
    {
        items.Add().Text("Item 1");
        items.Add().Text("Item 2");
        items.Add().Text("Item 3");
        items.Add().Text("Item 4");
    })
    .DropDownHtmlAttributes(new { @class = "shortDrop" } )
       
%>

CSS

.shortDrop
{
    height:70px !important;
}


Best wishes,
Dimo
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Anderson
Top achievements
Rank 1
answered on 18 Apr 2011, 02:44 PM
it works great!!!

thank you!!!
Tags
ComboBox
Asked by
Anderson
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Anderson
Top achievements
Rank 1
Dimo
Telerik team
Share this question
or