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

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

1 Answer 157 Views
DropDownList
This is a migrated thread and some comments may be shown as answers.
Sakthivel
Top achievements
Rank 1
Sakthivel asked on 15 Jun 2012, 01:06 PM
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?

1 Answer, 1 is accepted

Sort by
0
Sakthivel
Top achievements
Rank 1
answered on 21 Jun 2012, 02:22 PM
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.


Tags
DropDownList
Asked by
Sakthivel
Top achievements
Rank 1
Answers by
Sakthivel
Top achievements
Rank 1
Share this question
or