Adding Rows to Data-Bound DataGridView

If you are using a Data-Bound DataGridView control, you cannot just simply add new row by using the cell property of the control. A DataGridView that is bound using a DataSet can be access only using the DataSet properties. Forcing it to use the cell property can cause an error "Rows cannot be programmatically added to the DataGridView's rows collection when the control is data-bound." Adding new row to a DataGridView control programmatically is useful when you want to pull some data from another table to a Bound DataSet with another table. A good example of this is the Payroll system. A payroll table based only its record from employees table. Take note that the record in the DataGridView control in this project is just a sample data.

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. After downloading it, you will need a program like Winzip to decompress it.

Virus note: All files are scanned once-a-day by SourceCodester.com for viruses, but new viruses come out every day, so no prevention program can catch 100% of them.

FOR YOUR OWN SAFETY, PLEASE:

1. Re-scan downloaded files using your personal virus checker before using it.
2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.

Comments

Submitted bysdeb47 (not verified)on Fri, 07/06/2018 - 00:43

Thanks you very much for your support

Add new comment