I have a C# project, in which, although not running properly, actually runs. I have a DataGridView in this application.
Once I add a handler to the CellValueChanged event of the DataGridView, it throws an IndexOutOfBounds Exception. Removing the Event Handler, causes the exception to disappear.
The definition for the Event Handler is as follows:
private void rankingsDataGridView_CellValueChanged(object sender, DataGridViewCellEventArgs e)
UpdateTopPercentage(rankingsDataGridView[e.ColumnIndex, e.RowIndex].Value.ToString(), false);
It throws the IndexOutOfBounds on Initialize Component on the Form Load on the following line:
where this.Rank is a DataGridViewTextBoxCell which has been added to the DataGridView. As said before, merely eliminating the Event Handler rectifies the exception.
What could cause this error?