Empty item not displaying

3 posts, 1 answers
  1. Sergi
    Sergi avatar
    34 posts
    Member since:
    Sep 2007

    Posted 10 Jun 2013 Link to this post

    Hello.

    I'm doing a dropdownlist with the MVC helper like this, but the option with empty text is not showing, a red  line is showing instead.

    How can I show the empty option so that users can select, yes, no, or empty ( show all ) without having to set a text or value for that option?
                @(Html.Kendo().DropDownList().Name("isPublic")
                       .Items(items =>
                           {
                               items.Add().Text("").Value("");
                               items.Add().Text("Yes").Value("true");
                               items.Add().Text("No").Value("false");
                           }
                       )
                   )

    Thanks in advance.
  2. Answer
    Dimo
    Admin
    Dimo avatar
    8332 posts

    Posted 10 Jun 2013 Link to this post

    Hi Sergi,

    You can use the following CSS rule to expand the empty item:


    .k-popup > .k-list > .k-item
    {
        min-height: 1.8em;
    }


    In addition, please avoid posting duplicate forum threads.

    Regards,
    Dimo
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. UI for ASP.NET MVC is VS 2017 Ready
  4. Sergi
    Sergi avatar
    34 posts
    Member since:
    Sep 2007

    Posted 11 Jun 2013 Link to this post

    Thanks, sorry about the duplicate post, wasn't sure which forum was the right one for the question
Back to Top