Can't Save - Until Changing The DataGridView ROW Focus.
Hi All,
I have 2 objects the first is "DataGridView" And The Second is "Save Button".
The "Save Button" supposed to save the changes that occured in the "DataGridView" with this code :
orclDa.Update(orclDs, "tbname");
The Problem happen if I don't cahge the focus to different row, OR Enter to different row. The system Ignored and doesn't made the update.
Please Help,
Thanks Boaz.
The DataGridView commits when the row is validated and committed, which occurs when you move off the row. You can cause the validation/commit by calling Validate on your Form. You'll also need to ensure that your binding source is committed, then you can call Update. Here are the lines of code that we inject into the Save toolbar button when you use the designer:
| | this.Validate(); this.customersBindingSource.EndEdit(); this.customersTableAdapter.Update(this.northwindDataSet.Customers); |
-mark
Program Manager
Microsoft
This post is provided "as-is"