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.
Unfortunately, activation email could not send to your email. Please try again.

Repeater (Index 2 is not non-negative error)

Thread ID:

Created:

Updated:

Platform:

Replies:

21999 Nov 30,2004 10:08 PM Dec 1,2004 02:19 PM Windows Forms 3
loading
Tags: GridControl
Bernard Herrok
Asked On November 30, 2004 10:08 PM

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 November 30, 2004 10:09 PM

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 06:40 AM

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 02:19 PM

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.

CONFIRMATION

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.

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.

;