Windows Develop Bookmark and Share   
 index > Windows Forms Data Controls and Databinding > How to add new row from dataGridView
 

How to add new row from dataGridView

I bind dataGridView1 with bookBindingSource, now i wanted to add a new record from dataGridView to dataBase book table, how can i will do so.

Thanks

Mr.Jehan  Saturday, November 25, 2006 4:24 PM
I am not sure I understand the question. Are you looking for bookBindingSource.AddNew ?
Ken Tucker  Sunday, November 26, 2006 2:05 PM
I think I'm having a similar issue. I have a DataGridView that is bound to a Strongly Typed Dataset. The dataset is a simple Single Table collection of records. I GetData() to fill the dataset, but when I try to Add a new row

Dim thisDataGrid As DataGridView = RevisionEntities.PkgGrouper.Controls.Item("PackagesDataGridView")

Dim thisDataRow As Integer = thisDataGrid.Rows.Add()

I get an error stating "System.InvalidOperationException: Rows cannot be programmatically added to the DataGridView's rows collection when the control is data-bound"

Sam01m  Tuesday, November 28, 2006 3:37 PM

You can use google to search for other answers

Custom Search

More Threads

• Dynamically created GridView â€?use update postback
• datagridview combobox column
• Rich textbox and Context Menu
• Visual Web Dev. 2005 data entry and stored in database
• dataset count rows where?
• Databind with class properties
• Stopping DataGridView control to be redrawn when adding rows programmatically
• Live Search in a datagridview...
• dataset query sum(field)
• Daragrid cell refresh after databind