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

FilterExpressions throws "index error" on postback

3 Answers 41 Views
ListView
This is a migrated thread and some comments may be shown as answers.
Jason Horspool
Top achievements
Rank 1
Jason Horspool asked on 20 Jun 2011, 06:02 PM
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

3 Answers, 1 is accepted

Sort by
0
Veli
Telerik team
answered on 23 Jun 2011, 09:37 AM
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.

0
Jason Horspool
Top achievements
Rank 1
answered on 23 Jun 2011, 03:56 PM

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.
0
Veli
Telerik team
answered on 24 Jun 2011, 07:11 AM
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.

Tags
ListView
Asked by
Jason Horspool
Top achievements
Rank 1
Answers by
Veli
Telerik team
Jason Horspool
Top achievements
Rank 1
Share this question
or