[RESOLVED] [2005] Modify a row and then filter, exception: Index 1 does not have a value
My datagridview is binded to a binding source.
Then I change a value of a cell in column (c) in the first row, and click other rows.
Then I set the filter of the binding source by the other other than the very cell I modified.
The above exception occurs in my RowLeave function.
And this error occurs accidentally.
How I can fix it?
Re: [RESOLVED] [2005] Modify a row and then filter, exception: Index 1 does not have a value
This is marked resolved with no posted resolution.
If you have found an answer to your question, please post what you did. It could help others with the same or similiar question.
Thanks. :)
Re: [RESOLVED] [2005] Modify a row and then filter, exception: Index 1 does not have a value
Hi, thanks .
Actually it is just a bug issue, so I mark it resolved after I fix the bug.
After chosing a filter, just one row left, so bindingsource just has 1 row.
But I click the last row( new row), so the index is out of range.
I fix it by adding a judgment of index < bindingsource.count