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

Javascript Error Thrown After Using Transfer Buttons

5 Answers 47 Views
ListBox
This is a migrated thread and some comments may be shown as answers.
Brett
Top achievements
Rank 1
Brett asked on 19 Jul 2012, 01:03 PM
I have two RadListBoxes that are contained in a RadTabStrip. When I use the transfer buttons to move items from List1 to List2 and then click on a different tab, it throws me an error:

Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerServerErrorException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index

Any ideas what index field it's talking about?

Also, occasionally when I click on the Tab that contains the two RadListBoxes, they randomly disappear. The items in both lists are still visible but they just overlap each other on the left side of the page.

Thanks in advance!

5 Answers, 1 is accepted

Sort by
0
Nencho
Telerik team
answered on 24 Jul 2012, 12:21 PM
Hello Brett,

When you perform some action (transfer/reorder) with the RadListBoxes the changes are written to the client states of the both listboxes. This is done in a purpose to save the state to the server and updating the viewstate of the both controls. When the actions with the RadListBoxes take place, they both clear their client states. If you don't manage to update the state of the controls after performing the actions the client state is not correctly cleaned. Here is the root of the problem and the error you have faced. The viewstate of the page is updated by RadAjaxPanel and the changes made to the listboxes could be saved there. Therefor i recommend you to use RadAjaxPanel in order to correctly update the client state of the both controls and escape the experienced issue.


Greetings,
Nencho
the Telerik team
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 their blog feed now.
0
Brett
Top achievements
Rank 1
answered on 26 Jul 2012, 04:39 PM
I tried wrapping the RadListBoxes in a RadAjaxPanel but the error still occurs.
0
Nencho
Telerik team
answered on 27 Jul 2012, 03:23 PM
Hi Brett,

Could you please isolate the issue in a runnable sample and provide it to us, so we could examine the problem locally?


Regards,
Nencho
the Telerik team
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 their blog feed now.
0
Brett
Top achievements
Rank 1
answered on 27 Jul 2012, 04:26 PM
I tried shrinking the code down just to include only 2 tabs but I don't get the error when I do that and I don't want to send you my entire solution.

I uploaded the files for the page that I get the error on, you can downoad it here:

http://www.brettbousman.com/programs/Reports.zip

0
Brett
Top achievements
Rank 1
answered on 27 Jul 2012, 04:47 PM
Actually, disregard, I found the solution on another post.

I just had to set the "AutoPostBackOnTransfer" to True for the Source list box and that stopped the error.
Tags
ListBox
Asked by
Brett
Top achievements
Rank 1
Answers by
Nencho
Telerik team
Brett
Top achievements
Rank 1
Share this question
or