New row not committed in DataGridView

  • Thread starter Thread starter Wuschba
  • Start date Start date
W

Wuschba

Guest
Hi.

I have a DataGridView which is bound to a DataTable:
myDataGridView.DataSource = myDataTable;

The user does the following:
  • He creates new row by clicking on the last row of the DataGridView ("*").
  • He fills in the cells of this new row.
  • He navigates to other rows with the mouse or the arrow-keys.
  • He saves myDataTable. Result: The new line is lost.
If he does the same and clicks on one RowHeader (it doesnt matter, which) before saving, then the new row is saved!

I tried to call myDataGridView.EndEdit() before saving, but without any effect.

So how can I make the DataGridView commit the value to the DataTable immediately after it has been created? And why this is not happing automatically?

Continue reading...
 
Back
Top