I have a repeater custom control, and sometimes i get a ''System.IndexOutOfRangeException''.
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.
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
ADAdministrator Syncfusion Team 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.
BHBernard HerrokDecember 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.