We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Repeater (Index 2 is not non-negative error)

Thread ID:





21999 Dec 1,2004 03:08 AM UTC Dec 1,2004 07:19 PM UTC WinForms 3
Tags: GridControl
Bernard Herrok
Asked On December 1, 2004 03:08 AM UTC

I have a repeater custom control, and sometimes i get a ''System.IndexOutOfRangeException''. With this Index 2 is not non-negative and below total rows count. There are 2 cells still in the grid so i don''t know what''s going wrong.

Bernard Herrok
Replied On December 1, 2004 03:09 AM UTC

the error points to this function: ''helper method that maps grid''s row index to a DataRowView Private Function GetDataRowView(ByVal rowIndex As Integer) As DataRowView Return CType(Me.Grid.Model.TableStyle.DataSource, DataView)((rowIndex - 1)) End Function ''GetDataRowView

Administrator [Syncfusion]
Replied On December 1, 2004 11:40 AM UTC

Are there any other exceptions shown in the output window before you see this one? Can you modify our repeater sample to show this problem? If so, we can try to suggest a work-around. Worse case, you can put a check into that code to see if the index is valid. If not, you could try returning nothing or some valid value depending upon your needs.

Bernard Herrok
Replied On December 1, 2004 07:19 PM UTC

i think this function is important to return something though. it looks like it returns the index of datarow according to the cell index. it calls UserControlSetValues passing in the index. if no index, then it won''t know which row to populate the cells with.


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon