I'm using the same code used in the documentation to add items to a RadListBox on the client side. This is the page:
http://www.telerik.com/help/aspnet-ajax/listbox-client-object-api.html
Here is my ASPX:
<telerik:RadListBox ID="lstItems" Width="298" Height="495" runat="server" OnClientSelectedIndexChanging="changingItem">
</telerik:RadListBox>
And here is my JavaScript:
$find(pnlItemsId).expand();
var cboItems = $find(cboIntelligentSearchId).get_items();
var lstItems = $find(lstItemsId);
lstItems.trackChanges();
var ifrContent = $("#ifrContent")[0];
var currentItemKey;
if (ifrContent && ifrContent.contentWindow.getCurrentItemKey && typeof ifrContent.contentWindow.getCurrentItemKey == 'function')
{
currentItemKey = ifrContent.contentWindow.getCurrentItemKey();
}
var listItems = lstItems.get_items();
listItems.clear();
for (var i = 0; i < cboItems.get_count(); i++)
{
var cboItem = cboItems.getItem(i);
var itemName = cboItem.get_text();
var smItemId = cboItem.get_value();
var item = new Telerik.Web.UI.RadListBoxItem();
item.set_text(itemName);
item.set_value(smItemId);
listItems.add(item);
if (currentItemKey && currentItemKey == smItemId)
{
candidateSelectedNode = item;
selectedNode = item;
item.select();
}
}
lstItems.commitChanges();
When the JS finishes, the items appear in the ListBox, but the scrollbar appears as if it has, maybe, three items below the bottom of the ListBox and using the scrollbar shows about three additional items. However, approximately 100 items were added. The only way to get them to appear is to click on one of the items and use the down arrow to scroll to the bottom.
I've poked through the documentation as well as JS objects available on the ListBox and I've found no solution to the problem. Thanks in advance for your help.
http://www.telerik.com/help/aspnet-ajax/listbox-client-object-api.html
Here is my ASPX:
<telerik:RadListBox ID="lstItems" Width="298" Height="495" runat="server" OnClientSelectedIndexChanging="changingItem">
</telerik:RadListBox>
And here is my JavaScript:
$find(pnlItemsId).expand();
var cboItems = $find(cboIntelligentSearchId).get_items();
var lstItems = $find(lstItemsId);
lstItems.trackChanges();
var ifrContent = $("#ifrContent")[0];
var currentItemKey;
if (ifrContent && ifrContent.contentWindow.getCurrentItemKey && typeof ifrContent.contentWindow.getCurrentItemKey == 'function')
{
currentItemKey = ifrContent.contentWindow.getCurrentItemKey();
}
var listItems = lstItems.get_items();
listItems.clear();
for (var i = 0; i < cboItems.get_count(); i++)
{
var cboItem = cboItems.getItem(i);
var itemName = cboItem.get_text();
var smItemId = cboItem.get_value();
var item = new Telerik.Web.UI.RadListBoxItem();
item.set_text(itemName);
item.set_value(smItemId);
listItems.add(item);
if (currentItemKey && currentItemKey == smItemId)
{
candidateSelectedNode = item;
selectedNode = item;
item.select();
}
}
lstItems.commitChanges();
When the JS finishes, the items appear in the ListBox, but the scrollbar appears as if it has, maybe, three items below the bottom of the ListBox and using the scrollbar shows about three additional items. However, approximately 100 items were added. The only way to get them to appear is to click on one of the items and use the down arrow to scroll to the bottom.
I've poked through the documentation as well as JS objects available on the ListBox and I've found no solution to the problem. Thanks in advance for your help.