I work with a WinForms app.
I want to add one row to a DataGridView that this row must enter to database.
What event handler must I use to do this?
I work with a WinForms app. I want to add one row to a
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Is your
DataGridViewbound to that database? If so, you should be adding and deleting rows in that data source, not in the grid control itself. Try calling theAddNewmethod on the binding source.If you’re using a standalone
DataGridViewthat isn’t bound to a database, then you can call one of the many overloads of theAddmethod of the grid control’sRowscollection.