FilterExpressions throws "index error" on postback

4 posts, 0 answers
  1. Jason Horspool
    Jason Horspool avatar
    10 posts
    Member since:
    Oct 2006

    Posted 20 Jun 2011 Link to this post

    I have assigned multiple Group FilterExpressions to my ListView and am receiving the following error on postback:

    "Index was out of range. Must be non-negative and less than the size of the collection."

    Wondering if this indeed a bug or if I'm databinding my Listview incorrectly?  I'm using the NeedDataSource function of the ListView to load the data.  I have a button to "Apply Filter" that calls the RadListView1.Rebind method.  I've tried to trace but the error is thrown before any databinding occurs on the Listview (something to do with the Viewstate for the FilterExpressions on the ListView)?

    Thanks for any help,
    Jason
  2. Veli
    Admin
    Veli avatar
    2002 posts

    Posted 23 Jun 2011 Link to this post

    Hi Jason,

    We are unable to identify the cause of this issue from the description you provided. Can you show us some sample code related to the RadListView initialization, databinding and filtering. Also, if your listview is in a user control, can you also specify how do you instantiate the user control on your page.

    Veli
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Jason Horspool
    Jason Horspool avatar
    10 posts
    Member since:
    Oct 2006

    Posted 23 Jun 2011 Link to this post

    The RadListView is hosted within a user control that is loaded using the Page.LoadControl method and added to a PlaceHolder in the hosting pages Init function:

    Dim ctlTasks As Object = Page.LoadControl("/Controls/TasksControl.ascx")
    Me.PlaceHolder1.Controls.Add(ctlTasks)

    The user control then uses the NeedDataSource to databind the ListView.  It works fine until I assign any FilterExpressions to the ListView, once I do that, I cannot do any postback or I get the FilterExpressions error.
  5. Veli
    Admin
    Veli avatar
    2002 posts

    Posted 24 Jun 2011 Link to this post

    Can you send us the stack trace of the exception? As far as you describe, the user control is initialized properly, so is RadListView. If this issue persists, consider opening a regular support ticket where you can send us a stripped down runnable project we can debug locally. This will help us better identify the cause of this issue.

    Veli
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Back to Top