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

[Solved] Height problem of dropdownlist

1 Answer 133 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.
Nim
Top achievements
Rank 1
Nim asked on 04 Jan 2011, 11:06 PM
Hello,

When testing the following codes:

====
<% Html.BeginForm("Save", "Home"); %>
<%= Html.Telerik().DropDownList()
    .Name("productID")
    .HtmlAttributes(new {name = "productID"})
    .Items(item =>
    {
        item.Add().Text("").Value("0").Selected(true);
        item.Add().Text("Chai").Value("1");
        item.Add().Text("Chang").Value("2");
        item.Add().Text("Tofu").Value("3");
    })
%>
<% Html.EndForm(); %>
====

The height of the drop-down window shrinks.  It seems the first item "blank" is causing the issue.  Is there any plan to fix this?

Thank you!

1 Answer, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 05 Jan 2011, 01:26 PM
Hello Nim,

 
Thank you for drawing our attention to this erroneous behavior.

I am glad to inform you that this issue is already fixed and the fix will be included in the next official release of the Telerik Components for ASP.NET MVC.

As a workaround I can suggest you to set Text property to "&nbsp;" and Encode(false). Here is a code snippet showing the suggested approach:

<%= Html.Telerik().DropDownList()
        .Name("Test1")
        .SelectedIndex(0)
        .Encode(false)
        .BindTo(new List<SelectListItem> {
                    new SelectListItem { Text = " ", Value = "1" },
                    new SelectListItem { Text = "Item2", Value = "2" },
                    new SelectListItem { Text = "Item3", Value = "3" }
        })
%>

I have updated your Telerik points.

Best wishes,
Georgi Krustev
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
Tags
ComboBox
Asked by
Nim
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Share this question
or