Hello,
I am trying to use a RadListBox to display items that a user has selected on a RadGrid.
There is an instance where, on a button click, I am attempting to add 2000+ items to the radlistbox. This is all being done in JavaScript.
When adding this many items, the browers (IE 8) displays a message stating that there is script being run on the page that is causing the page to not respond. I believe this is being caused by having to add so many items to the RadListBox.
Is there a workaround for this, or another control that i can use to display selected items from the grid? I need to keep this on client side in Javascript.
Here is the script that I am using to add items to the RadListBox (my radlistbox is named rlbSelectedContacts):
var rlbSelectedContacts = $find("<%=rlbSelectedContacts.ClientID %>");
if (rlbSelectedContacts)
{
for (each item in my list of items to add) //this FOR loop could iterate thousands of times
{
var item = new Telerik.Web.UI.RadListBoxItem();
if (item)
{
item.set_text(contactName);
item.set_value(contactId);
rlbSelectedContacts.trackChanges();
rlbSelectedContacts.get_items().add(item);
rlbSelectedContacts.commitChanges();
}
}
}
I am trying to use a RadListBox to display items that a user has selected on a RadGrid.
There is an instance where, on a button click, I am attempting to add 2000+ items to the radlistbox. This is all being done in JavaScript.
When adding this many items, the browers (IE 8) displays a message stating that there is script being run on the page that is causing the page to not respond. I believe this is being caused by having to add so many items to the RadListBox.
Is there a workaround for this, or another control that i can use to display selected items from the grid? I need to keep this on client side in Javascript.
Here is the script that I am using to add items to the RadListBox (my radlistbox is named rlbSelectedContacts):
var rlbSelectedContacts = $find("<%=rlbSelectedContacts.ClientID %>");
if (rlbSelectedContacts)
{
for (each item in my list of items to add) //this FOR loop could iterate thousands of times
{
var item = new Telerik.Web.UI.RadListBoxItem();
if (item)
{
item.set_text(contactName);
item.set_value(contactId);
rlbSelectedContacts.trackChanges();
rlbSelectedContacts.get_items().add(item);
rlbSelectedContacts.commitChanges();
}
}
}