I have a screen with RadComboBox with these parameters:
<telerik:RadComboBox ID="RadComboBox1" runat="server"
OnClientItemsRequested="OnClientItemsRequestedHandler"
OnClientDropDownOpening="OnClientItemsRequestedHandler"
EnableLoadOnDemand="true"
OnItemsRequested="RadComboBox1_ItemsRequested">
<ExpandAnimation Type="none" />
<CollapseAnimation Type="none" />
</telerik:RadComboBox>
and this code :
<script type="text/javascript">
function OnClientItemsRequestedHandler(sender, eventArgs)
{
//set the max allowed height of the combo
var MAX_ALLOWED_HEIGHT = 220;
//this is the single item's height
var SINGLE_ITEM_HEIGHT = 22;
var calculatedHeight = sender.get_items().get_count() * SINGLE_ITEM_HEIGHT;
var dropDownDiv = sender.get_dropDownElement();
if (calculatedHeight > MAX_ALLOWED_HEIGHT)
{
setTimeout (
function () {
dropDownDiv.firstChild.style.height = MAX_ALLOWED_HEIGHT + "px";
}, 20
);
}
else
{
setTimeout (
function () {
dropDownDiv.firstChild.style.height = calculatedHeight + "px";
}, 20
);
}
}
</script>
The problem is when the dropdown is expanding Up and the height of the dropdown is reduced, the dropdown is render far from the combo box input field.
Like that: