How do you add a row to a databound datagridview using the datagridview in the gui?

Posted by IsaacB on Stack Overflow See other posts from Stack Overflow or by IsaacB
Published on 2010-06-18T06:58:42Z Indexed on 2010/06/18 7:03 UTC
Read the original article Hit count: 308

Filed under:
|
|
|

Hi guys,

I've bound a datagridview to a collection of objects. It's giving me a null reference exception when I try to add a new row to a collection (empty or otherwise) using the gui. More specifically, when there is a write event it does this.

How can I override the behavior of the write event and manually add all of the columns contents to the object collection?

I could disable the add new row feature and make an add button, but the built in datagridview row add looks so much more slick.

© Stack Overflow or respective owner

Related posts about c#

Related posts about .NET