J
Jason Barnett
I created a custom class that implements IBindingList. I've tested the class
and all properties and methods function as I expect.
When I assign an object (of my IBindingList class) to the DataSource
property of a DataGridView, everything appears to work fine. Records appear
appropriately. I'm able to add a new record, edit an existing, and delete
and existing all fine. However, if I enter the last row (AddNew row), exit
the row (without making any edits), and re-enter the last row (AddNew row),
then I get an error in my code stating that "Operation is not valid due to
the current state of the object."
I also notice that when I enter the last row, a new row is added to my
underlying collection, but when I exit the row (without making any edits)
then the row is not removed even though it does not appear in the
DataGridView.
How do I get the DataGridView to notify my IBindingList class that the new
row has been canceled?
I posted to this newsgroup, because I didn't feel this was related to a
specific language. However, if there is a more appropriate newsgroup for
this discussion, please let me know.
For what it's worth, I'm working with a VB.NET application, using the v2.0
frameworks and Visual Studio 2005.
and all properties and methods function as I expect.
When I assign an object (of my IBindingList class) to the DataSource
property of a DataGridView, everything appears to work fine. Records appear
appropriately. I'm able to add a new record, edit an existing, and delete
and existing all fine. However, if I enter the last row (AddNew row), exit
the row (without making any edits), and re-enter the last row (AddNew row),
then I get an error in my code stating that "Operation is not valid due to
the current state of the object."
I also notice that when I enter the last row, a new row is added to my
underlying collection, but when I exit the row (without making any edits)
then the row is not removed even though it does not appear in the
DataGridView.
How do I get the DataGridView to notify my IBindingList class that the new
row has been canceled?
I posted to this newsgroup, because I didn't feel this was related to a
specific language. However, if there is a more appropriate newsgroup for
this discussion, please let me know.
For what it's worth, I'm working with a VB.NET application, using the v2.0
frameworks and Visual Studio 2005.