Javascript Error Thrown After Using Transfer Buttons

6 posts, 0 answers
  1. Brett
    Brett avatar
    11 posts
    Member since:
    Jan 2012

    Posted 19 Jul 2012 Link to this post

    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!
  2. Nencho
    Admin
    Nencho avatar
    1458 posts

    Posted 24 Jul 2012 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Brett
    Brett avatar
    11 posts
    Member since:
    Jan 2012

    Posted 26 Jul 2012 Link to this post

    I tried wrapping the RadListBoxes in a RadAjaxPanel but the error still occurs.
  5. Nencho
    Admin
    Nencho avatar
    1458 posts

    Posted 27 Jul 2012 Link to this post

    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.
  6. Brett
    Brett avatar
    11 posts
    Member since:
    Jan 2012

    Posted 27 Jul 2012 Link to this post

    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

  7. Brett
    Brett avatar
    11 posts
    Member since:
    Jan 2012

    Posted 27 Jul 2012 Link to this post

    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.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017