How to set the Drop Down List's List Area Height?

2 posts, 0 answers
  1. Sakthivel
    Sakthivel avatar
    6 posts
    Member since:
    Jun 2012

    Posted 15 Jun 2012 Link to this post

    Could any body tell me how to set the height of the Popup area of a drop-down list box? And that of a Customized template?
  2. Sakthivel
    Sakthivel avatar
    6 posts
    Member since:
    Jun 2012

    Posted 21 Jun 2012 Link to this post

    I finally got a solution for this. This worked for me in all Kendo List controls such as AutoComplete, ComboBox and DropDownList. Even it worked for me when using templates for the list popup. 

    The following is what i used for Kendo Combo Box, which uses a template to show Images and some text in the list popup area. 

    dataBound: function ()
            {
                var KOImages = $("#InpImages").data("kendoComboBox");
                KOImages.list.width(300);
                var KOImagesView = KOImages.dataSource.view();
                if (KOImagesView != null)
                {
                    var ListHeight = 125 * KOImagesView.length;
                    if (ListHeight >= 500) ListHeight = 500;
                    KOImages.list.height(ListHeight);
                }
            }


    Here 125 is the height of an individual list item. When the number of items shown in the list is above 4, i fix the height with '500px', so that i get the scroll bar in the list popup.


Back to Top