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

Set drop down height of radcombobox dynamically

1 Answer 254 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
MRa
Top achievements
Rank 1
MRa asked on 03 Oct 2013, 09:40 PM
i'm setting the scroll area of the radgrid dynamically on gridcreated:

               var heightResolution = screen.height;
                var screenHeight = heightResolution - (heightResolution * 0.40);

                $get("content").style.height = screenHeight;

                var scrollArea = sender.GridDataDiv;

                scrollArea.style.height = screenHeight + "px";

is there any way to do something similar with the drop down portion of the radcombobox?

I'd like to set the height to a specific percentage of the page based on user's resolution.

1 Answer, 1 is accepted

Sort by
0
Hristo Valyavicharski
Telerik team
answered on 08 Oct 2013, 03:46 PM
Hi,

Probably there are multiple approaches you can use, but here are two of them:
  • Get screen resolution on the server as described in this forum post and set the MaxHeight property of the combo in its OnInit event:
    protected void RadComboBox1_Init(object sender, EventArgs e)
    {
        RadComboBox1.MaxHeight = 300;
    }
  • Set the height of the combo on the client. For example in the OnClientDropDownOpened event:
    function OnClientDropDownOpened(sender, args) {
        setTimeout(function () {
            $('.rcbScroll.rcbWidth').height(60);
        }, 10);
    }

Regards,
Hristo Valyavicharski
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Tags
ComboBox
Asked by
MRa
Top achievements
Rank 1
Answers by
Hristo Valyavicharski
Telerik team
Share this question
or