After deleting last item, ajax call fails

2 posts, 0 answers
  1. ido nahmias
    ido nahmias avatar
    64 posts
    Member since:
    May 2006

    Posted 05 Aug 2014 Link to this post

    I am using a RadListBox for adding and deleting items. To delete the item from the list i use:  "listBox.deleteItem(selectedItem);" and items are deleted from the list successfully.  After adding items and deleting all of the items (leaving no items in the list) , an ajax call i make fails, and does not reach the required function on the server side. if no items are added to the list, or some items are added to the list, or some items are added and some are deleted but not all of the items the ajax call succeeds.  The exception i receive is:  "Uncaught Sys.WebForms.PageRequestManagerServerErrorException: Sys.WebForms.PageRequestManagerServerErrorException: Index was out of range. Must be non-negative and less than the size of the collection.
    Parameter name: index

    Thanks for the help in advance.

  2. Peter Filipov
    Peter Filipov avatar
    1028 posts

    Posted 08 Aug 2014 Link to this post

    Hi Ido,

    Please make sure that you call the track/commit changes methods and update the RadListBox control on every ajax call.
    Could you send me a sample page which reproduces the behavior?

    Peter Filipov

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

Back to Top